How to take the distance from the scroll bar to the top of the page in Internet Explorer?

Asked

Viewed 233 times

2

In the other browsers with you through the

$(document).scrollTop();

But in IE it always returns 0;

1 answer

2


According to this response from the OS you can do it like this:

var top = (document.documentElement && document.documentElement.scrollTop) || 
    document.body.scrollTop;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.