Team:StanfordBrownSpelman/jquery.scroll

From 2014.igem.org

(Difference between revisions)
 
(16 intermediate revisions not shown)
Line 1: Line 1:
$(document).ready(function() {
$(document).ready(function() {
-
var scrollSpeed = 100;
+
var scrollSpeed = 750;
 +
var space = -10;
$("#team").click(function() {
$("#team").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#teamNoodle").offset().top
+
         scrollTop: $("#teamNoodle").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
     });
     });
-
$("#projects").click(function() {
+
$("#project").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#place").offset().top + 15
+
         scrollTop: $("#Projects").offset().top
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 19: Line 20:
$("#wiki").click(function() {
$("#wiki").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#splash").offset().top
+
         scrollTop: $("#splash").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 26: Line 27:
$("#contact").click(function() {
$("#contact").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#precontact").offset().top
+
         scrollTop: $("#precontact").offset().top + space
 +
    }, scrollSpeed);
 +
    return false;
 +
    });
 +
 
 +
$("#future").click(function() {
 +
    $('body, html').animate({
 +
        scrollTop: $("#forecast").offset().top + space
 +
    }, scrollSpeed);
 +
    return false;
 +
    });
 +
 
 +
$("#wax").click(function() {
 +
    $('body, html').animate({
 +
        scrollTop: $("#esters").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 33: Line 48:
$("#pics").click(function() {
$("#pics").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#images").offset().top
+
         scrollTop: $("#images").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 40: Line 55:
$("#intro").click(function() {
$("#intro").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#int").offset().top
+
         scrollTop: $("#int").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 47: Line 62:
$("#data").click(function() {
$("#data").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#results").offset().top
+
         scrollTop: $("#results").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 54: Line 69:
$("#methods").click(function() {
$("#methods").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#process").offset().top
+
         scrollTop: $("#process").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 61: Line 76:
$("#links").click(function() {
$("#links").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#references").offset().top
+
         scrollTop: $("#references").offset().top + space
 +
    }, scrollSpeed);
 +
    return false;
 +
    });
 +
 
 +
$("#conclude").click(function() {
 +
    $('body, html').animate({
 +
        scrollTop: $("#final").offset().top + space
 +
    }, scrollSpeed);
 +
    return false;
 +
    });
 +
 
 +
$("#chassis").click(function() {
 +
    $('body, html').animate({
 +
        scrollTop: $("#amberlesschassis").offset().top + space
 +
    }, scrollSpeed);
 +
    return false;
 +
    });
 +
 
 +
$(".ourLab").click(function() {
 +
    $('body, html').animate({
 +
        scrollTop: $(".ourLab2").offset().top + space
 +
    }, scrollSpeed);
 +
    return false;
 +
    });
 +
 
 +
$("#moreinfo").click(function() {
 +
    $('body, html').animate({
 +
        scrollTop: $("#linkout").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;
     return false;
Line 74: Line 117:
$("#top2").click(function() {
$("#top2").click(function() {
 +
    $('body, html').animate({
 +
        scrollTop: '0px'}, scrollSpeed);
 +
    return false;
 +
    });
 +
 +
$("#top3").click(function() {
     $('body, html').animate({
     $('body, html').animate({
         scrollTop: '0px'}, scrollSpeed);
         scrollTop: '0px'}, scrollSpeed);
Line 81: Line 130:
$("#contact").click(function() {
$("#contact").click(function() {
     $('body, html').animate({
     $('body, html').animate({
-
         scrollTop: $("#test2").offset().top
+
         scrollTop: $("#test2").offset().top + space
     }, scrollSpeed);
     }, scrollSpeed);
     return false;  
     return false;  
     });
     });
             });
             });

Latest revision as of 03:28, 18 October 2014

$(document).ready(function() {

var scrollSpeed = 750; var space = -10;

$("#team").click(function() {

   $('body, html').animate({
       scrollTop: $("#teamNoodle").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#project").click(function() {

   $('body, html').animate({
       scrollTop: $("#Projects").offset().top
   }, scrollSpeed);
   return false;
   });
   

$("#wiki").click(function() {

   $('body, html').animate({
       scrollTop: $("#splash").offset().top + space
   }, scrollSpeed);
   return false;
   });
   

$("#contact").click(function() {

   $('body, html').animate({
       scrollTop: $("#precontact").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#future").click(function() {

   $('body, html').animate({
       scrollTop: $("#forecast").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#wax").click(function() {

   $('body, html').animate({
       scrollTop: $("#esters").offset().top + space
   }, scrollSpeed);
   return false;
   });
   

$("#pics").click(function() {

   $('body, html').animate({
       scrollTop: $("#images").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#intro").click(function() {

   $('body, html').animate({
       scrollTop: $("#int").offset().top + space
   }, scrollSpeed);
   return false;
   });
   

$("#data").click(function() {

   $('body, html').animate({
       scrollTop: $("#results").offset().top + space
   }, scrollSpeed);
   return false;
   });
   

$("#methods").click(function() {

   $('body, html').animate({
       scrollTop: $("#process").offset().top + space
   }, scrollSpeed);
   return false;
   });
   

$("#links").click(function() {

   $('body, html').animate({
       scrollTop: $("#references").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#conclude").click(function() {

   $('body, html').animate({
       scrollTop: $("#final").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#chassis").click(function() {

   $('body, html').animate({
       scrollTop: $("#amberlesschassis").offset().top + space
   }, scrollSpeed);
   return false;
   });

$(".ourLab").click(function() {

   $('body, html').animate({
       scrollTop: $(".ourLab2").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#moreinfo").click(function() {

   $('body, html').animate({
       scrollTop: $("#linkout").offset().top + space
   }, scrollSpeed);
   return false;
   });

$("#top").click(function() {

   $('body, html').animate({
       scrollTop: $("#header").offset().top - $("#header").height()
   }, scrollSpeed);
   return false;
   });

$("#top2").click(function() {

   $('body, html').animate({
       scrollTop: '0px'}, scrollSpeed);
   return false;
   });

$("#top3").click(function() {

   $('body, html').animate({
       scrollTop: '0px'}, scrollSpeed);
   return false;
   });

$("#contact").click(function() {

   $('body, html').animate({
       scrollTop: $("#test2").offset().top + space
   }, scrollSpeed);
   return false; 
   });
            });