• Resolved gniuskap

    (@gniuskap)


    Hello,

    I am trying to configure four independent sliders in a 2×2 grid. I want them each to have a duration of 5 seconds before they have a transition, however want them to offset by 1 second each. I am trying to create a sort of domino effect so that they evenly transition but not at the same time.

    Is there any way I can initialize the slider so it is configured to delay for a second or two, while still having the same duration time.

    Find below an example of what I am talking about, laying out when the photos would transition.

    Example:

    Photo 1: 5s 10s 15s 20s etc.
    Photo 2: 6s 11s 16s 21s etc.
    Photo 3: 7s 12s 17s 22s etc.
    Photo 4: 8s 13s 18s 23s etc.

    • This topic was modified 6 years, 8 months ago by gniuskap.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @gniuskap

    If you are using FlexSlider you can use something like this to check the next slide, stop the slideshow for x amount of seconds, then start it again. Let me know if this works.

    add_filter('metaslider_flex_slider_parameters', function ($options, $id) {
    
    	$options['before'] = isset($options['before']) ? $options['before'] : array();
    	$options['before'] = array_merge($options['before'], array(
    		"if (slider.animatingTo === 1) {
    			slider.stop();
    			setTimeout(function() {
    				slider.play()
    			}, 8000)
    		}"
    	));
    	return $options;
    }, 10, 2);
    • This reply was modified 6 years, 8 months ago by Kevin Batdorf.
    Thread Starter gniuskap

    (@gniuskap)

    Hi Kbatdorf,

    Thank you so much for your reply! I’m not sure if I explained what I am trying to achieve accurately.

    I have four independent slides with a fade transition set up. I want them all to have a duration of 5 seconds before transitioning, however, do not want them to transition at the same time. I want to offset the transition by about 2 seconds, so it cascades.

    I think my example made it a bit confusing.

    Slider 1: 5s 10s 15s 20s etc.
    Slider 2: 7s 12s 17s 22s etc.
    Slider 3: 9s 14s 19s 24s etc
    Slider 4: 11s 16s 21s 26s etc.

    Essentially, I want to independently control the timing of just the first image, so that there is this domino effect in totality. Does this make more sense?

    Thank you in advance!

    Hi @gniuskap,

    Did you try the function I gave you? As far as I can tell it does what you want but uses 8 seconds instead of 5 (update 8000 to 5000).

    Hi @gniuskap

    I’ll mark this as resolved as we didn’t hear back, but feel free to reply if needed.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Setting a delay before transition’ is closed to new replies.