//非FF
//event.wheelDelta
// 正数:向上滚动,负数:向下滚动
// 滚动一次值120
document.body.onmousewheel = function (event) {
event = event || window.event;
log(‘onmousewheel‘);
log(event);
log(‘event.detail=‘ + event.detail);//0
log(‘event.wheelDelta=‘ + event.wheelDelta);
};
//FF
// event.detail
// 正数:向下滚动,负数:向上滚动
// 向上滚动一页值为-32768,向下滚动一页值为+32768,其他值代表滚动的行数, 方向代表了数值的正负号
// 受信任的事件是不会给detail赋值0
document.body.addEventListener("DOMMouseScroll", function (event) {
log(‘DOMMouseScroll‘);
log(event);
log(event.detail);
});
function log(arg) {
window.console && window.console.log(arg);
}
mousewheel 与 DOMMouseScroll,布布扣,bubuko.com
原文:http://blog.csdn.net/spy19881201/article/details/38704621