Template:Team:Berkeley/topnav.js
From 2013.igem.org
(Difference between revisions)
Line 9: | Line 9: | ||
); | ); | ||
- | + | var offsetHeight = 51; | |
var scrollPos = $('body > .container').find($(this).attr('href')).offset().top - (offsetHeight - 1); | var scrollPos = $('body > .container').find($(this).attr('href')).offset().top - (offsetHeight - 1); | ||
Revision as of 01:32, 28 October 2013
$(window).scroll(function () {
if ($(window).scrollTop() > 289) { $('#main-nav').css('top', $(window).scrollTop() - 289); } else { $('#main-nav').css('top', 0); }
} );
var offsetHeight = 51; var scrollPos = $('body > .container').find($(this).attr('href')).offset().top - (offsetHeight - 1);
$('body').scrollspy({
offset: offsetHeight
});