Template:Team:Berkeley/sidenav.js
From 2013.igem.org
(Difference between revisions)
(Created page with "$(window).scroll(function () { if ($(window).scrollLeft() > 225) { $('#navbar').css('left', $(window).scrollLeft() - 225); } else { $('#navbar').css('...") |
|||
Line 1: | Line 1: | ||
$(window).scroll(function () { | $(window).scroll(function () { | ||
- | if ($(window).scrollLeft() > | + | if ($(window).scrollLeft() > 0) { |
- | $('#navbar').css('left', $(window).scrollLeft() | + | $('#navbar').css('left', -($(window).scrollLeft()) + 50); |
} | } | ||
else { | else { | ||
- | $('#navbar').css('left', | + | $('#navbar').css('left', 50); |
} | } | ||
} | } | ||
); | ); |
Revision as of 22:52, 24 October 2013
$(window).scroll(function () {
if ($(window).scrollLeft() > 0) { $('#navbar').css('left', -($(window).scrollLeft()) + 50); } else { $('#navbar').css('left', 50); }
} );