Okay
  Public Ticket #1865596
Event Callback
Closed

Comments

  •  3
    mary feuer started the conversation

    You answered this question previously in October; however the question and its answer are no longer in my ticket queue for some reason.  At the time I wanted to autoplay a slider and then stop it on a specific slide. You provided the following code to  be inserted in SlideChangeDidComplete:

    function( event, slider ) {
    if( slider.slides.current.index == 2 ) {
    slider.api('stop');
    }
    }

    This worked fine to stop the slider after the second slide. Now, I need to stop a different slider after the first slide instead of the second. I inserted the same code, and it does stop after slide 2 as it did the first time. I tried changing the 2 to a 1, assuming that was the key to stopping on slide 1, but apparently this is not how the code functions because it did not work. Please advise. 

  • [deleted] replied

    Hello mary feuer,

    Thank you for getting in touch with us. My name is Attila and I'm happy to assist you today. I appreciate your patience while we've been working towards your ticket.

    The same event cannot be used for the first slide in this case, as the SlideChangeDidComplete event is triggered when the slide change already happened. And since you're on the first slide, there was no slide change yet.

    You could just simply disable the Auto-start slideshow option, so your slider will stop on the first slide by default.

    Or if you really want to use the API, you can utilize the slideChangeWillStart event to stop the slideshow at the end of the first slide.

  •  3
    mary feuer replied

    The problem is that I do want the first slide to autoplay, though. If I disable autoplay, won't they have to push play to make it play at all? I want it to stop at the END of the first slide, not the start. 

    In the meantime, I did create a second slide so I could still use the slidechangedidcomplete code.  But that brought up a different issue. 

    There are several layers that continue from slide 1 to slide 2 (menu buttons). If someone makes a menu selection prior to slide 2 ending, those buttons end up continuing onto the next slide, and the slides that follow, which are not designed to autoplay, DO autoplay, with the menu buttons superimposed even though they are only supposed to be on slides 1 and 2.  Basically, the code is being ignored once a menu button is pressed, which makes sense because it no longer fits the criteria of the slide having completed, and I guess because the selected slide is now the second one to appear it is causing the menu buttons to stay on even though they should be gone.  So I am wondering if there is some other place to put a similar command. 

    Is there ANY way to use the API to make it so that:

    a) the slideshow autoplays the first and second slide; BUT

    b) if one of those two slides are interrupted by the viewer making a selection, the autoplay still stops, and does not superimpose the static layers onto all subsequent layers?

  • [deleted] replied

    No, the first slide still plays when the Auto-start slideshow option is disabled. It stops the slides from advancing, not the layers. So it will animate everything and stop at the end of the first slide.

    As I've mentioned the SlideChangeDidComplete event cannot be used for this, not even if you add a second slide. It will only stop after a slide change has happened, so you cannot use it to pause at the end of the first slide. But the above mentioned method will do exactly that.