drift icon indicating copy to clipboard operation
drift copied to clipboard

window.scrollX and window.scrollY compatibility on IE 11

Open andreg opened this issue 10 years ago • 5 comments

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.

andreg avatar Jul 15 '16 13:07 andreg

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

paulstraw avatar Jul 15 '16 19:07 paulstraw

All set, and released as 0.3.2!

paulstraw avatar Jul 15 '16 20:07 paulstraw

Thank you!

andreg avatar Jul 16 '16 12:07 andreg

for better compatibility; https://github.com/ReactTraining/react-router/issues/605

blowsie avatar Jan 12 '17 08:01 blowsie

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

    }
})

})

mateusmrosa avatar Apr 30 '21 23:04 mateusmrosa