Pause slideshow (Stop the loop)

Hello. I’m trying to do what the OP was asking for on this thread:
https://www.wix.com/corvid/forum/community-discussion/stop-this-slideshow

Unlike him, I AM using the standard slideshow feature, and identical to him, would like the slideshow to stop after the 3rd slide and not continue to loop.

I used the code suggested, and changed my id:
$w.onReady( function () {
$w(“#heroslider”).onChange((event, $w) => {
let currentIndex = event.target.currentIndex; // 3

if (currentIndex === 3){
$w(“#heroslider”).pause();
}
});
});

However, the code is not working.
Since the discussion on the previous thread continue to fix a Gallery issue, I’m re-starting this question to ask for help troubleshooting the slideshow issue.

Thank you!

Are you sure the index is 3? In JS, the first index is almost universally 0, so the third item would be 2.

Brilliant. Easy. Done.

That’s awesome. Thank you!

Hello - I’m also experiencing a similar issue. So it should look like this if you have 3 slides, with the current index at 0 set at 2 in both places in the code? This works when I go to preview, but when I send out the feedback link, it’s still looping. I don’t have a way of knowing if it will work when I push the slide live or not…

$w.onReady( function () {
$w(“#fullWidthSlides1”).onChange((event, $w) => {
let currentIndex = event.target.currentIndex; // 2

if (currentIndex === 2){
$w(“#fullWidthSlides1”).pause();
}
});
});

Anything that goes after this // in the code panel is a human-readable comment, the computer/browser will do nothing with it. So the only number that matters here is the one that goes inside the if statement. What do you mean by the feedback link?

@skmedia the link under “site” “get feedback” - it’s the link i’ve sent to get comments on a preview version of the site

@swkofoed
That feedback link is a Wix Editor feature and nothing to do with Wix Corvid, if you want more info for that then you need to be contacting Wix Support and not asking here as it is not code related.
https://support.wix.com/en/article/sharing-your-site-to-get-feedback-from-others
https://support.wix.com/en/about-wix/contacting-wix-support

Notes:

  • The shared link is valid for 2 weeks only.

  • You can send an un-published site.

  • Only site owners see the feedback, contributors cannot see it.

  • Protected pages (with passwords and set to members-only) are accessible in Get Feedback.

  • Once you publish your site, the shared link leads to the latest saved version of your site (not the latest published version). This allows you to share drafts with others without having to publish these changes first.

@givemeawhisky so if i’m seeing that the carousel is pausing in my preview link, that means it’s working and will push live that way? i understand that the feedback link has nothing to do with Corvid, but it’s concerning that the code i implemented in Corvid appears to not be working on this version of the site

I’m also only seeing this work if I access preview from within editor. If I hit the preview link from the dashboard, the slideshows aren’t playing at all.

That is because the preview from the dashboard is just showing you a read only document view.
You need to actually use the preview from within the editor itself as that gives you full control.
https://www.wix.com/corvid/forum/community-discussion/solved-code-not-working-when-previewing-from-dashboard