Finding the Scroll Position in IE10

I hate to label this a “device bug”, but since everyone else supports it, and someone doesn’t, I’ll label it as such…

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! :-)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s