event.pageY
retrieves the mouse position in relation to the overall document height (
document.documentElement.offsetHeight
in my understanding).
However, I am curious about how to obtain the mouse position concerning the current viewport, which is
document.documentElement.clientHeight
?
For example, if the browser window's height is 720 pixels, and I scroll down 3 pages while keeping the mouse at the center of the window, the position should be "360", not 1800 (720 x 3 - 720 / 2).