Template:Team:Berkeley/topnav.js
From 2013.igem.org
(Difference between revisions)
Line 2: | Line 2: | ||
if ($(window).scrollTop() > 225) { | if ($(window).scrollTop() > 225) { | ||
$('#main-nav').css('top', $(window).scrollTop() - 225); | $('#main-nav').css('top', $(window).scrollTop() - 225); | ||
+ | } | ||
+ | else { | ||
+ | $('#scroller').css('top', 0); | ||
} | } | ||
} | } | ||
); | ); |
Revision as of 20:50, 24 October 2013
$(window).scroll(function () {
if ($(window).scrollTop() > 225) { $('#main-nav').css('top', $(window).scrollTop() - 225); } else { $('#scroller').css('top', 0); }
} );