wix-location.to() updated with scroll support

Hi,
You can now use the wix-location.to() API to navigate to another page in your site and scroll to a specific element on that page, instead of scrolling to top.

Example:
In the attached site we define the onClick of “My Certifications” button as follows:

export function buttonToCertifications_click(event) {
wixLocation.to('/more-about-me#certifications');
}

The button:

Feel free to try it yourself here :slight_smile:
Enjoy!

6 Likes

You should add an option to choose whether to open the link in a new tab or not.

1 Like