Last Updated: February 25, 2016
·
3.128K
· okcoker

Use window.pageYOffset instead of window.scrollY

For better cross browser compatibility. Same goes for pageXOffset over scrollX.