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

event.pageY is browser dependend #3676

Closed
cmb69 opened this issue May 25, 2017 · 3 comments
Closed

event.pageY is browser dependend #3676

cmb69 opened this issue May 25, 2017 · 3 comments

Comments

@cmb69
Copy link

cmb69 commented May 25, 2017

Description

event.pageY is browser dependent if there is a margin-top set for the <html> element. While on most browsers I've tested (Chrome 58.0.3029.110, Firefox 53.0.2 and Edge 38.14393.1066.0) it takes into account the margin-top, it doesn't do so on IE 11.1198.14393.0. I would expect the behavior to be consistent.

Link to test case

https://jsfiddle.net/5a1536bq/

Open the console to see the debug values. Both should be roughly the same, but on IE they're not.

PS: to see the debug output, you have to click on "foo".

@dmethvin
Copy link
Member

This is a long-standing problem with margins on the html or body elements. There are comments already for .offset() and .position in the documentation about this issue and it's from the same cause.

Most CSS resets explicitly set margin and padding on html and body to 0 which would solve the issue. Is that something you can do?

@cmb69
Copy link
Author

cmb69 commented May 26, 2017

We use the margin-top in a CMS to add a menu at the top of the viewport, pushing down the rest of the theme, and not setting margin-top respectively would cause a lot of other issues. I can work around this issue, though.

Anyhow, after some further testing, this is obviously a bug in IE, since event.clientY reports an expected value, see https://jsfiddle.net/5a1536bq/6/.

@timmywil
Copy link
Member

timmywil commented Jun 2, 2017

Thank you for opening an issue, but we're not likely to make changes here.

@timmywil timmywil closed this as completed Jun 2, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants