This event is different from IE under the standard.
Firefox is implemented according to the standard. The event name is "DOMMouseScroll", and that of IE is "mousewheel ".
Of course, one line of code solves the compatibility problem.
VarMousewheel = Document. All? "Mousewheel": "dommousescroll ";
For the event attribute, ie is event. wheeldelta, Firefox is the event. Detail attribute with different direction values. IE is rolled up> 0, and Firefox is rolled down> 0. Use the plug-in mouse wheel extension 3.0.2
Http://plugins.jquery.com/files/jquery.mousewheel.3.0.2.zip address http://brandonaaron.net/code/mousewheel/demos
Jquery (function ($ ){
$ ('Div. mousewheel_example ')
. BIND ('mousewheel ', function (event, Delta ){
VaR dir = delta> 0? 'Up': 'low ',
Vel = math. Abs (DELTA );
$ (This). text (dir + 'at a velocity of '+ vel );
Return false;
});
});