Team:SDU-Denmark/window
From 2012.igem.org
<script> $(function() {
var $sidebar = $("#sidenav"), $window = $(window), offset = $sidebar.offset(), topPadding = 15;
$window.scroll(function() { if ($window.scrollTop() > offset.top + 250 ) { $sidebar.stop().animate({ marginTop: $window.scrollTop() - (offset.top + topPadding + 230 ) }); } else { $sidebar.stop().animate({ marginTop: 0 }); } });
}); </script>