判断鼠标滚轮的滚动方向
function mousewheelHandler(e){
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
console.log(delta > 0 ? "向上滚动" : "向下滚动");
}
//for Firefox
document.addEventListener("DOMMouseScroll", mousewheelHandler, false);
//for Chrome Safari
document.addEventListener("mousewheel", mousewheelHandler, false);