在firefox浏览器中没有触发mousewheel事件 [英] mousewheel event is not triggering in firefox browser
本文介绍了在firefox浏览器中没有触发mousewheel事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请参阅以下代码。
$(this.element).on("mousewheel", this.chartMouseWheel);
chartMouseWheel:function(e) {
if(e.originalEvent.wheelDelta /120 > 0) {
alert('scrolling up !');
}
else{
alert('scrolling down !');
}
if (e.preventDefault)
e.preventDefault();
e.returnValue = false;
},
这个事件在IE浏览器中正确触发,chrome并且在Firefox中没有触发?
this event triggering properly in IE,chrome and not triggering in Firefox ?
推荐答案
从版本3开始,Firefox无法识别鼠标滚轮。您应该使用DOMMouseScroll代替firefox。
Firefox doesn't recognize "mousewheel" as of version 3. You should use "DOMMouseScroll" instead for firefox.
检查: http://www.javascriptkit.com/javatutors/onmousewheel .shtml
这篇关于在firefox浏览器中没有触发mousewheel事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文