Template:MIT-results
From 2012.igem.org
(Difference between revisions)
Line 26: | Line 26: | ||
window.location.href=name; | window.location.href=name; | ||
}); | }); | ||
+ | |||
+ | //Moving the menu down the screen, if we jump to the middle of the page. | ||
+ | var $sidebar = $("#col_nav"), | ||
+ | offset = $sidebar.offset(), | ||
+ | topPadding = 0, | ||
+ | $window = $(window); | ||
+ | if ($window.scrollTop() > offset.top - topPadding) { | ||
+ | $sidebar.css({'margin-top': $window.scrollTop() - offset.top + topPadding}) | ||
+ | } else { | ||
+ | $sidebar.css({'margin-top': 0}) | ||
+ | } | ||
}); | }); | ||