I think this may be the easier way To get the current scroll position of the page or any scrollable element element.scrollHeight
element.scrollHeight