js:鼠标滚轮事件
参考 http://www.cnblogs.com/walkingp/archive/2010/02/03/1662872.html
1.注册事件
//Firefox if(document.addEventListener) { document.addEventListener("DOMMouseScroll",scrollFunc,false); } // safari chrome IE Opera window.onmousewheel = document.onmousewheel = scrollFunc;
2.节流,防止滚轮一次,触发两次事件
var timer = null; function scrollFunc(){ clearTimeout(timer); timer = setTimeout(function(){},100) }