Button delay time

How can you customize the delay time of a button with Velo?

What do you mean?

Hello J.D.

Very simple: I need my CTA (click to action) button under my video sales letter to show only when I make my sales pitch. The problem is: Wix only gives you an eight-second delay animation. I have tried adding some code using the Velo mode I found here somewhere but whitout success.

Thank you for the reply,


I’m sorry, I don’t think I understand the question. You’re talking about Video Sell Letter, Sales pitch and animation max delay and I don’t know what they are (maybe someone else? Maybe explain with screenshots)
Anyway, if you just want to add a delay after button click (is that what you wanted?) you can use setTimeout like:

$w.onReady(() => {
    $w('#button1').onClick(() => {
        setTimeout(() => {
            ///code to execute
        }, 10000/*milliseconds*/);

The easy way to do it would be

    }, 10000/*milliseconds*/);})

where you originally hid the button, then it shows after X amount of seconds (in this case 10 seconds) after the page has loaded.

If you want the countdown until it’s being shown to only start once the video has started you can use the onPlay() function.

//shows the button 10 seconds after the video starts playing
$w("#myVideoPlayer").onPlay( (event) => {
    }, 10000/*milliseconds*/);})