This event is different under standards and IE. Firefox is implemented according to standards, and the event name is "DOMMouseScroll", while IE uses "mousewheel".
Of course one line of code solves the compatibility problem
var mousewheel = document.all?"mousewheel":"DOMMouseScroll";
Event attribute, IE is event.wheelDelta, Firefox is event.detail. The direction value of the attribute is also different, IE upward Scroll > 0, Firefox scroll down > 0.
The latest jquery 1.3.2 still does not add wheel events, but you can use jquery's bind to bind any event, of course you must add the above sentence.
However, there is a plug-in for jquery that has added this function. See http://brandonaaron.net/code/mousewheel/demos
Use like this:
$('div.mousewheel_example').mousewheel(fn);
$('div.mousewheel_example').bind('mousewheel', fn);
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn