Get Scroll Position

Get current scroll position of the page.

Code

Utilities
return {
  x: window.pageXOffset || document.documentElement.scrollLeft,
  y: window.pageYOffset || document.documentElement.scrollTop
};

Parameters

Example parameter.

Browser·fetch() may be limited by CORS

More JavaScript Snippets