scrollTo( )


Scrolls a page to the specified location.

The x and y parameters determine the top-left pixel that is displayed on screen after the scroll.

Tip: To get the coordinates for scrolling, click on an element to open the Inspector panel (Wix Studio), or open the Editor toolbar (Wix Editor). Then move the cursor to the top-left pixel where you want the page to scroll to. The X and Y axis Position values show the coordinates.

Use the options parameter to specify the options to use when scrolling.

Method Declaration
Copy
function scrollTo(
  x: number,
  y: number,
  options: ScrollToOptions,
): Promise<void>;
Method Parameters
xnumberRequired

The horizontal position, in pixels, to scroll to.


ynumberRequired

The vertical position, in pixels, to scroll to.


optionsScrollToOptions

Scrolling options.

JavaScript
import wixWindowFrontend from "wix-window-frontend"; // ... wixWindowFrontend.scrollTo(100, 500);
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?