var scrollPosition = window.scrollY
var scrollPosition = window.pageYOffset | document.body.scrollTop
The read-only scrollY property of the Window interface returns the number of pixels that the document is currently scrolled vertically
The pageYOffset property is an alias for the scrollY property
An element's scrollTop value is a measurement of the distance from the element's top to its topmost visible content