Team:StanfordBrownSpelman/jquery.scroll

From 2014.igem.org

Revision as of 17:18, 11 October 2014 by Raman2004 (Talk | contribs)

$(document).ready(function() {

var scrollSpeed = 750; var space = -10;

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

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

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

   $('body, html').animate({
       scrollTop: $("#place").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;
   });
   

$("#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;
   });

$("#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;
   });

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

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