Template:Team:Berkeley/scrollspyOffset.js

From 2013.igem.org

(Difference between revisions)
 
(16 intermediate revisions not shown)
Line 1: Line 1:
 +
var offset = 81;
-
var offset = 980;
+
$('#navbar li a').click(function(event) {
-
 
+
-
$('.navbar li a').click(function(event) {
+
     event.preventDefault();
     event.preventDefault();
     $($(this).attr('href'))[0].scrollIntoView();
     $($(this).attr('href'))[0].scrollIntoView();
     scrollBy(0, -offset);
     scrollBy(0, -offset);
});
});

Latest revision as of 16:55, 28 October 2013

var offset = 81;

$('#navbar li a').click(function(event) {

   event.preventDefault();
   $($(this).attr('href'))[0].scrollIntoView();
   scrollBy(0, -offset);

});