For cross-browser compatibility, use window.pageYOffset instead of window.scrollY

For cross-browser compatibility, use window.pageYOffset instead of window.scrollY