js鼠标滚轮事件

时间:2014-07-01 13:02:52   收藏:0   阅读:235

不多说,直接上代码。

//非ie
document.body.onmousewheel = function(event) {
	event = event || window.event;
	console.dir(event);
};
//firefox
document.body.addEventListener("DOMMouseScroll", function(event) {
	console.dir(event);
});

 

更详细的鼠标滚轮事件请参考

1   http://www.adomas.org/javascript-mouse-wheel/

2   http://www.zhangxinxu.com/wordpress/2013/04/js-mousewheel-dommousescroll-event/ 【总结的非常好】

js鼠标滚轮事件,布布扣,bubuko.com

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!