getScrollPosition
Returns the scroll position of the current page.
- Use
Window.pageXOffsetandWindow.pageYOffsetif they are defined, otherwiseElement.scrollLeftandElement.scrollTop. - Omit the single argument,
el, to use a default value ofwindow.