Mouse Wheel Plugin Update (2.1.1)

With jQuery 1.1.3 arriving soon, I’ve updated the Mouse Wheel plugin to work with the updated event system. If you don’t know already, jQuery 1.1.3 will use DOM Level 2 methods (addEventListener and attachEvent) instead of DOM Level 1 methods (element.onclick) under-the-hood. Most code will not be affected by this move to DOM Level 2 event handlers. However, the Mouse Wheel plugin deals directly with normalizing the mouse wheel event and just needed a minor tweak to be compatible.

You can grab the latest release zipped up from the Mouse Wheel project page which includes the full source with documentation, a packed version, a minified version, a test/example and the change log. You could also just checkout the latest from SVN hosted at Google Code.

4 Responses to “Mouse Wheel Plugin Update (2.1.1)”

  1. Jesper Larsen Says:

    If you try and add the following on a new line after line 100:
    console.log(’PageX: (’+event.pageX+’) PageY: (’+event.pageY+’)');

    Do you get the expected output i FireFox 2?

    I would expect to get x,y coordinates of where on the page the mousewheel where used.
    Am i doing something wrong, or is it perhaps a bug in FF?

    This is a FF only issue, and only in conjunction with the mousewheel plugin. PageX and pageY functions as expected with e.g. onclick or mouseover…

    Regards Jesper

  2. Brandon Aaron Says:

    It is a Firefox bug and should be fixed in the latest builds according to this bug report (#352179).

    For now you will have to use the mousemove event to store the value of the mouse position for use later in conjunction with the mouse wheel.

  3. Brandon Aaron » Blog Archive » Mouse Wheel Plugin Update (2.2) Says:

    [...] Larsen reminded me in his recent comment that Firefox does not properly report the pageX, pageY, clientX and/or clientY event properties on [...]

  4. Brandon Aaron Says:

    The latest version of the mousewheel plugin now handles this internally so you don’t have to deal with it. You can grab the latest version from the project page.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>