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.
function scrollTo(
x: number,
y: number,
options: ScrollToOptions,
): Promise<void>;
The horizontal position, in pixels, to scroll to.
The vertical position, in pixels, to scroll to.
Scrolling options.
import wixWindowFrontend from "wix-window-frontend";
// ...
wixWindowFrontend.scrollTo(100, 500);
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.