Line 50: | Line 50: | ||
<!-- 以高度包围--> | <!-- 以高度包围--> | ||
<div class="screen-hidden" style="height: 70px;top: 16px;" > | <div class="screen-hidden" style="height: 70px;top: 16px;" > | ||
− | <nav class="navbar navbar-default | + | <nav class="navbar navbar-default"> |
<div class="container-fluid"> | <div class="container-fluid"> | ||
<div class="navbar-header"> | <div class="navbar-header"> | ||
Line 191: | Line 191: | ||
<script src="https://2017.igem.org/Team:BIT-China/js/basic/jquery-2-0-0?action=raw&ctype=text/javascript"></script> | <script src="https://2017.igem.org/Team:BIT-China/js/basic/jquery-2-0-0?action=raw&ctype=text/javascript"></script> | ||
<script src="https://2017.igem.org/Team:BIT-China/js/bootstrap3-3-7?action=raw&ctype=text/javascript"></script> | <script src="https://2017.igem.org/Team:BIT-China/js/bootstrap3-3-7?action=raw&ctype=text/javascript"></script> | ||
+ | <script> | ||
+ | |||
+ | $(document).ready(function (e) { | ||
+ | |||
+ | window.onscroll = function(e){ | ||
+ | |||
+ | var e =e || window.event; | ||
+ | var scrolltop=document.documentElement.scrollTop||document.body.scrollTop; | ||
+ | |||
+ | $navbar = $("nav.nav_bar"); | ||
+ | if(scrolltop > 80){ | ||
+ | $navbar.css({'position': 'fixed','opacity': 0, 'display': 'none' }); | ||
+ | $("#left_nav").css({'position': 'fixed','left': 0,'top': 0}); | ||
+ | }else{ | ||
+ | $navbar.css({'position': 'relative','opacity': 1, 'display': 'block'}); | ||
+ | $("#left_nav").css({'position': 'relative','height': '100%'}); | ||
+ | } | ||
+ | |||
+ | }; | ||
+ | }); | ||
+ | </script> | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 15:07, 5 October 2017