windowpageYOffset
WindowPageYOffset is a property in JavaScript that returns the number of pixels that the document has been scrolled vertically. It is a read-only property and is part of the Window interface. This property is particularly useful for creating interactive web pages that need to respond to the user's scrolling actions. For example, it can be used to trigger animations, lazy load content, or change the layout of a page based on the user's scroll position. The value of window.pageYOffset is zero when the page is at the top and increases as the user scrolls down. It is important to note that this property is not supported in Internet Explorer 8 and earlier versions. In those browsers, an alternative method using document.documentElement.scrollTop or document.body.scrollTop is required.