Returns the current scroll position of the window.
An object containing x (horizontal) and y (vertical) scroll coordinates.
x
y
const { x, y } = getScrollPosition();console.log(`Scroll X: ${x}, Scroll Y: ${y}`); Copy
const { x, y } = getScrollPosition();console.log(`Scroll X: ${x}, Scroll Y: ${y}`);
1.1.0
Returns the current scroll position of the window.