Template:Team:SCUT-China/mainpage
From 2014.igem.org
(Difference between revisions)
Yanzw scut (Talk | contribs) |
|||
Line 82: | Line 82: | ||
}); | }); | ||
}) | }) | ||
+ | </script> | ||
+ | |||
+ | <script type="text/javascript"> | ||
+ | $(document).ready(function(){ | ||
+ | var element = $("#navi"); | ||
+ | var top = element.position().top; | ||
+ | var pos = element.css("position"); | ||
+ | $(window).scroll(function(){ | ||
+ | var scrolls = $(this).scrollTop() + 30; | ||
+ | if (scrolls > top) | ||
+ | { | ||
+ | element.css({position:"fixed",top:30}); | ||
+ | } | ||
+ | else { | ||
+ | element.css({position:pos,top:top}); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 22:46, 17 October 2014