Team:SDU-Denmark/window
From 2012.igem.org
(Difference between revisions)
Asbiorn (Talk | contribs)
(Created page with "<script> $(function() { var $sidebar = $("#sidenav"), $window = $(window), offset = $sidebar.offset(), topPadding = 15; $window.scroll...")
Newer edit →
(Created page with "<script> $(function() { var $sidebar = $("#sidenav"), $window = $(window), offset = $sidebar.offset(), topPadding = 15; $window.scroll...")
Newer edit →
Revision as of 11:47, 6 August 2012
<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>