Mouse Wheel Plugin Update (2.1.1)

Tuesday, June 5, 2007

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.

Posted in jQuery with 3 comments

Comments

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

By Jesper Larsen on Wednesday, June 20, 2007 at 05:22 AM

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.

By Brandon Aaron on Wednesday, June 20, 2007 at 06:49 AM

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.

By Brandon Aaron on Wednesday, October 29, 2008 at 02:04 AM

New Comment