标签:blog java 2014 javascript cti for
实现鼠标滚动滚轮事件:
<script type="text/javascript"> var scrollFunc=function(e){ e=e || window.event; if(e.wheelDelta){//IE/Opera/Chrome if(e.wheelDelta==120) { //向上滚动事件 alert(e.wheelDeta +"向上"); }else { //向上滚动事件 alert(e.wheelDeta +"向上"); } }else if(e.detail){ //Firefox if(e.detail==-3) { //向上滚动事件<br> alert(e.detail +"向上"); }else { //向下滚动事件<br> alert(e.detail +"向下 "); } } }; if(document.addEventListener){ //adding the event listerner for Mozilla document.addEventListener("DOMMouseScroll" ,scrollFunc, false); } //IE/Opera/Chrome window.onmousewheel=document.onmousewheel=scrollFunc; </script>
javascript滚动条响应鼠标滑轮的实现上下滚动事件,布布扣,bubuko.com
标签:blog java 2014 javascript cti for
原文地址:http://blog.csdn.net/fengshizty/article/details/36003159