setTimeout based on slideindex

I got two related questions:

  1. I am doing some text animation for the text to hide and show at a particular time, not sure which method is correct, either just do setTimeout which seems not working all the time, or I found about Promise.all which I never get it to work.

setTimeout( function () { $w( “#text5” ).hide(); }, 3700 );
setTimeout( function () { $w( “#text37” ).show( “glide” , { “duration” : 1200 , “delay” : 0 , “angle” : 0 , “distance” : 145 }) ; }, 3700 );

//Promise.all([
//(() => { setTimeout(function() { $w(‘#text5’).hide(); }); 2500 })(),
//(() => { setTimeout(function() { $w(‘#text37’).show(); }); 2500 })(),
//(() => { setTimeout(function() { $w(‘#text37’).hide(); }); 3700 })(),

  1. the whole thing of question 1 should only active in a particular fullwidethslide page, but apparently the setTimeout run on page load, any pausing and skipping of the slides make the animation.
    sequence all in wrong orders.

Any way to fix it?? Thanks.

Hello SMB,

the question is, what exactly do you want to achieve?

You try to do a text-animation, ok.
But you do not show the wohle code.
It is important to see, where you do place your code.

You say …

the whole thing of question 1 should only active in a particular fullwidethslide page, but apparently the setTimeout run on page load
…so i think you putted it to the onReady function, so it is normal that it starts right from the beginning when the page loads.

What is your wished ACTION-SEQUENCE?
What should happen exactly? Describe the action-flow.

  1. Page loads, then after 3,7sec i want to hide text5 and after the same time, i want to show “text37”… and so on …

yes, it is currently under onReady, I want the code to load only when the slideshow reaches slide 2. So setTimeout based on the slide too, not the page.

Sorry i did not see any code for SLIDESHOW .

Take a look at this …
https://www.wix.com/corvid/reference/$w/slideshow