$(window).scroll(function(){
var y = window.scrollY;//754到达
if(y > 754){
$("#mynav").css({position:"fixed",top:0});
}else{
$("#mynav").css({position:"relative"});
}
});
时间: 2024-11-08 21:10:09