欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery實現(xiàn)的導(dǎo)航固定效果

 更新時間:2014年04月28日 10:01:42   作者:  
這篇文章主要介紹了jquery實現(xiàn)的導(dǎo)航固定效果,需要的朋友可以參考下

jquery實現(xiàn)的導(dǎo)航固定效果

復(fù)制代碼 代碼如下:

1.jquery代碼, .nav為導(dǎo)航的class
$(function(){ 
  $(window).scroll(function() {
 if($(window).scrollTop()>=250){
  $(".nav").addClass("fixedNav");
 }else{
  $(".nav").removeClass("fixedNav");
 }
  });
});

2.CSS代碼
.fixedNav{
 position:fixed;
 top:0px;
 left:0px;
 width:100%;
 z-index:100000;
 _position:absolute;
 _top:expression(eval(document.documentElement.scrollTop));
}

3.HTML代碼
<div class="nav">
    <p>導(dǎo)航固定</p>
</div>

相關(guān)文章

最新評論