滚轮事件 onmousewheel (event.wheelDelta<0:滚轮向下,event.wheelDelta>0:滚轮向上) 【firefox不支持】 DOMMouseScroll(使用addEventListener事件绑定) (event.detail < 0:滚轮向上,event.detail > 0:滚轮向下) 【firefox支持方法】 滚轮事件兼容写法: function mouseWheelFn(element, upFn, downFn){ element.onmousewheel = fn; if(window.addEventListener){ element.addEventListener("DOMMouseScroll", fn, false); } function fn(e){ var e = e || window.event; // 判断滚轮方向(向上) if(e.wheelDelta > 0 || e.detail < 0){ upFn(); }else{ downFn(); } // 阻止冒泡 e.cancelBubble = true; e.stopPropagation(); } }