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

window.scrollX and window.scrollY compatibility on IE 11 #33

Closed
andreg opened this issue Jul 15, 2016 · 5 comments
Closed

window.scrollX and window.scrollY compatibility on IE 11 #33

andreg opened this issue Jul 15, 2016 · 5 comments

Comments

@andreg
Copy link

andreg commented Jul 15, 2016

Hi,

there's an issue of the plugin not being able to properly position the zoom pane on IE 11, because the computation required to assign the top and left values returns NaN.

This can be fixed using window.pageXOffset and window.pageYOffset instead of window.scrollX and window.scrollY. As you can see here, using window.pageXOffset is better for cross-browser compat.

@paulstraw
Copy link
Member

Good catch @andreg, I'll get this fixed up in a second.

@paulstraw
Copy link
Member

All set, and released as 0.3.2!

@andreg
Copy link
Author

andreg commented Jul 16, 2016

Thank you!

@blowsie
Copy link

blowsie commented Jan 12, 2017

for better compatibility;
remix-run/react-router#605

@mateusmrosa
Copy link

$(document).ready(function() {
$(window).scroll(function() {
var scroll = window.scrollY
if (scroll > 20) {
$('.navbar').addClass("sticky")
} else {
$('.navbar').removeClass("sticky")

    }
})

})

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

No branches or pull requests

4 participants