Fix calculating scroll top in some browsers

https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY