How do I get the distance from the scroll bar to the top of the page in Internet Explorer?

2

In other browsers with you

$(document).scrollTop();

But in IE this always returns 0;

    
asked by anonymous 25.02.2015 / 22:28

1 answer

2

According to this SO response you can do this:

var top = (document.documentElement && document.documentElement.scrollTop) || 
    document.body.scrollTop;
    
25.02.2015 / 22:36