scrollTo( )

Scrolls the page to the top of the element using an animation.


The scrollTo() function returns a Promise that is resolved when the animated scroll is complete and the element is in view.

To scroll to a specific location on the page, see the wix-window scrollTo() function.

Tip: Use the wix-window scrollTo() function to

scroll directly to an element, and also disable the animation. To get the coordinates for scrolling, display the Wix Editor Toolbar. In the Editor, 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.

Note: You can't call the scrollTo() function on an element inside a repeater.


function scrollTo(): Promise<void>

scrollTo Parameters

This function does not take any parameters.


Fulfilled - When the scroll is complete.

Return Type:

Mixed in from:$w.Element

Was this helpful?

Scroll the page to an element

Code Example

Copy Code
Scroll the page to an element and log message when done

Code Example

Copy Code
2 .then( ( ) => {
3 console.log("Done with scroll");
4} );