其实在大多数浏览器(IE6, IE7, IE8, Opera 10+, Safari 5+)中,都提供了 “mousewheel” 事件。但杯具的是 Firefox 3.5+ 却不支持此事件,不过庆幸 Firefox 3.5+ 中提供了另外一个等同的事件:”DOMMouseScroll” (事件和事件属性的测试案例)。
xmlns="http://www.w3.org/1999/xhtml">
Mousewheel Event in JavaScript
- IE6, IE7, IE8, Opera 10+, Safari 5+ support mousewheel.
- Firefox 3.5+ support DOMMouseScroll.
- IE6, IE7, IE8, Opera 10+, Safari 5+ support event.wheelDelta.
- Firefox 3.5+, Opera 10+ support event.detail.
- The event.wheelDelta value is a multiple of 120.
- The event.detail value is a multiple of 3.
Mousewheel Event: mousewheel
Mousewheel Event: DOMMouseScroll
Related Articles: http://www.planabc.net/2010/08/12/mousewheel_event_in_javascript/