onReady Scroll to Top for Slideshows

Hi all!

I’m using a full-width slideshow as a sort of “quiz”, where users select a button on the slide and it redirects them to a particular slide in the slideshow based on the button they selected.

When they click a button and get redirected to the next slide, it doesn’t bring them to the top of the page, which cuts off the text I’ve put at the top of the slide.

Is there something I can do in Wix Code to bring the user to the top of the page every time the slideshow loads?

Hello Vincent,

You can add a 3rd party app that does this, more on that here.
There is also a built in “Go-To-Top” button in Wix under the Buttons category.
And finally there is the option to do it with anchors, here i s a tutorial for that.

Best,
Majd

Of course, how it ‘plays nice’ with whatever slide-show gizmo you’re using is always an issue. However, since you seem ‘onReady’ savvy, then you can do it simply in code within the $w.onReady() or your own function(s) with:

wixWindow.scrollTo(10, 0);

The API has an extensive explanation but the two values are X and Y coordinates as they appear in the Toolbar (in the editor) and you don’t need to add any other parameters. Love the ‘Anchors’ method in the video, but this is a single line of code that gets it done… let alone the two and a half minutes to watch the video. [Of course, at the top, be sure to

import wixWindow from 'wix-window';

]