Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalise offsetX and offsetY on the event #99

Merged
merged 1 commit into from
Apr 9, 2014
Merged

Normalise offsetX and offsetY on the event #99

merged 1 commit into from
Apr 9, 2014

Conversation

chriscbrock
Copy link
Contributor

According to the W3C Working Draft, offsetX and offsetY should be
relative to the padding edge of the target element. The only browser
using this convention is IE. Webkit uses the border edge, Opera uses the
content edge, and FireFox does not support the properties.

Normalizing to the border edge is easiest to do.

According to the W3C Working Draft, offsetX and offsetY should be
relative to the padding edge of the target element. The only browser
using this convention is IE. Webkit uses the border edge, Opera uses the
content edge, and FireFox does not support the properties.

Normalizing to the border edge is easiest to do.
@vendruscolo
Copy link

👍 this also fixes the plugin on Firefox 27. At the moment, offsetX and offsetY are always undefined (they're fine on Safari & Chrome).

@brandonaaron
Copy link
Contributor

Seems like this should be put into jQuery proper so that all events get the correct offsetX/Y.

@chriscbrock
Copy link
Contributor Author

jQuery doesnt normalise offsetX and offsetY, only pageX and pageY, all they do is copy the event properties. I'm picking they have done this after discussion, and are unlikely to change their position. (https://api.jquery.com/category/events/event-object/)

It would be nice if jQuery normalised more of the properties, but I guess thats where this plugin comes in, to normalise the properties of the events specific to the mousewheel/DOMMouseScroll events

@brandonaaron
Copy link
Contributor

True and thanks for the pull request. I'm hoping to make some time soon to test this and hopefully land it.

@brandonaaron brandonaaron merged commit 36f7799 into jquery:master Apr 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants