Team:HZAU-China/Gallery

From 2013.igem.org

(Difference between revisions)
Line 92: Line 92:
ul.menu input.close:checked ~ ul li {margin-top:-30px;}
ul.menu input.close:checked ~ ul li {margin-top:-30px;}
</style>
</style>
-
 
-
 
-
<script>
 
-
$(document).ready(function(){
 
-
var topMain=$("#sidebar").height()+100//是头部的高度加头部与nav导航之间的距离
 
-
var menu=$(".menu");
 
-
$(window).scroll(function(){
 
-
if ($(window).scrollTop()>topMain){//如果滚动条顶部的距离大于topMain则就nav导航就添加类.nav_scroll,否则就移除
 
-
menu.addClass("menu_scroll");
 
-
}else{
 
-
menu.removeClass("menu_scroll");
 
-
}
 
-
});
 
-
})
 
-
</script>
 
<body>
<body>

Revision as of 15:55, 27 September 2013