Finding the Scroll Position in IE10

It’s been so long since I had to deal with IE that I had forgotten about this, but IE does not support window.scrollX/window.scrollY; you have to use window.pageXOffset/window.pageYOffset

So this is an effective way to find the current vertical scroll position:
var top = (window.scrollY || window.pageYOffset);

One more teeny difference for the mobile web! :-)

5 Responses to Finding the Scroll Position in IE10

    • Steve S. says:

      Near as I can tell, it isn’t. I spent the last hour trying to get that to play nice across Chrome, Firefox and Safari, and ultimately window.scrollY was the only thing that worked for all of them.

Leave a Reply

Your email address will not be published. Required fields are marked *