Get scroll position in Javascript

I would like to retrieve the current scroll position in Javascript, after some research I found this: window.scrollY and window.scollTop.

But the problem is that it does not work 100% on all browsers, is there something more reliable?


Source: cross-browser

Leave a Reply