Custom slide interval ?

Issue #3 resolved
Former user created an issue

Is it posibble to change intercal for various slides to various values ? Now default is 5000ms for all slides but for example how to do to make slide no 2 to be visible for longer time ?

Comments (6)

  1. Lukasz Kokoszkiewicz repo owner

    Hi, I have to say it's unusual use case but it's possible to do it with my slider. You would have to turn off automatic slide change and program the intervals manually using 'next' method. If you have more questions I will be happy to answer.

  2. Tomek A

    Hi Lukasz.

    I need to have only first slide to stay longer because I want to add in first slide another slideshow (just changing 3 items).

    So i would like by default for example 5000ms and for first slide I need 9000ms.

    I have the onSlideChange callback. Can I access somehow the variable (in code it is 'slide') with the current slide number ? And can I change the interval when after slide 1 and then after last slide.

    It would be best then.

  3. Lukasz Kokoszkiewicz repo owner

    Hi Tomek,

    You can access internal counter like this:

    $('#responsive-slider').data('slider').current;
    // first slide number is 2
    

    To change different slides with the different interval you will have to program the slides change manually using 'next' method and based on the current element number set different timeout before the 'next' method will be invoked. You can use onSlideChange callback to invoke 'next' method with the appropriate timeout based on current slide number.

  4. Tomek A

    Ok. Thanks.

    But what about responsiveness ? This way it can happen so that the slide change can occur during browser change (for example rotating phone). When resizing browser the slide change should stop and reset yes ? But I have no idea how to handle that.

  5. Lukasz Kokoszkiewicz repo owner

    If would go with the simplest solution and on every resize reset the slider to first slide.

  6. Log in to comment