<script type="text/javascript">
$(function(){
if ($.browser.msie && ($.browser.version == "6.0") && !$.support.style) {
var handler,sTop,dTop;
dTop = $("#fixedNav").offset().top
$(window).bind('scroll',function(){
window.clearTimeout(handler);
handler = window.setTimeout(function(){
sTop = $(document).scrollTop();
sTop > dTop $("#fixedNav").css("top",sTop - dTop) : $("#fixedNav").css("top",0);
$("#fixedNav").css({"position":"relative","z-index":"1200"});
},60);
});
}else{
var topMain= $("#fixedNav").offset().top
$(window).scroll(function(){
if ($(window).scrollTop()>topMain){
$("#fixedNav").addClass("nav_scroll");
}else{
$("#fixedNav").removeClass("nav_scroll");
}
});
}
});
</script>
.nav_scroll{ position:fixed;top:0;left:0;z-index:1200; width:100%;}
上一篇: