:<!DOCTYPEhtmlPUBLIC"-//W3C////EN"""><htmlxmlns=""><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><scriptsrc="js/jquery-"type="text/javascript"></script><title>div随滚动条滚动置顶</title><styletype="text/css">#floatMenu{width:1200px;height:50px;background-color:#000;}.fixedFloat{position:fixed;top:10px;}</style></head><body><div><divstyle="height:300px;background-color:red;"></div><divid="floatMenu"style="color:white;">随滚动条滚动置顶</div><divstyle="height:1800px;background-color:grey;"></div></div><scripttype="text/javascript">varname="#floatMenu";varmenuYloc=null;$(document).ready(function(){menuYloc=300;$(window).scroll(function(){if($(document).scrollTop()<=menuYloc){$("#floatMenu").removeClass("fixedFloat");}else{$("#floatMenu").addClass("fixedFloat");}});});</script></body></html>2、jquery滚轮停止事件代码如下:<!DOCTYPEhtmlPUBLIC"-//W3C////EN"""><htmlxmlns=""><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><scripttype="text/javascript"src="js/jquery-"></script><script>$(document).ready(function(e){//让scroll事件在滚动条停止时响应vartimeout=false;$(window).scroll(function(){if(timeout){clearTimeout(timeout);}timeout=setTimeout(function(){(1);},500);});});</script><title>jquery滚轮停止事件</title></head><body><divid="my_elem"style="background-color:red;height:4000px;width:800px;marg
jquery滚动条事件 来自淘豆网m.daumloan.com转载请标明出处.