# Button delay time

**URL:** <https://forum.wixstudio.com/t/button-delay-time/173>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [May 1, 2022, 4:41pm UTC](https://forum.wixstudio.com/t/button-delay-time/173 "2022-05-01T16:41:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![williamdalmazzo](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/williamdalmazzo/32/33247_2.png) [@williamdalmazzo](https://forum.wixstudio.com/u/williamdalmazzo)\
**Post date:** [May 1, 2022, 4:41pm UTC](https://forum.wixstudio.com/t/button-delay-time/173/1 "2022-05-01T16:41:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [May 1, 2022, 7:41pm UTC](https://forum.wixstudio.com/t/button-delay-time/173/2 "2022-05-01T19:41:11Z")

</div>

What do you mean?

---

<div class="post-metadata">

**Author:** ![williamdalmazzo](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/williamdalmazzo/32/33247_2.png) [@williamdalmazzo](https://forum.wixstudio.com/u/williamdalmazzo)\
**Post date:** [May 1, 2022, 8:07pm UTC](https://forum.wixstudio.com/t/button-delay-time/173/3 "2022-05-01T20:07:17Z")

</div>

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,

Will

---

<div class="post-metadata">

**Author:** ![J.D](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/j.d/32/7312_2.png) [@J.D](https://forum.wixstudio.com/u/J.D)\
**Post date:** [May 2, 2022, 10:15am UTC](https://forum.wixstudio.com/t/button-delay-time/173/4 "2022-05-02T10:15:57Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![simen](https://avatars.discourse-cdn.com/v4/letter/s/7cd45c/32.png) [@simen](https://forum.wixstudio.com/u/simen)\
**Post date:** [May 2, 2022, 11:47am UTC](https://forum.wixstudio.com/t/button-delay-time/173/5 "2022-05-02T11:47:33Z")

</div>

The easy way to do it would be

```javascript
$w.onReady(()=>{
     setTimeout(()=>{
         $w('#button1').show()
    }, 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.

> **[onPlay - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/$w/videoplayer/onplay)**
>
> Adds an event handler that runs when playback is started or restarted. A video can be played by a user clicking the video player's play button or by calling ...

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

```

---

<div class="post-metadata">

**Author:** ![Estefani\_Hobus](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/estefani_hobus/32/107005_2.png) [@Estefani\_Hobus](https://forum.wixstudio.com/u/Estefani_Hobus)\
**Post date:** [April 1, 2025, 2:06pm UTC](https://forum.wixstudio.com/t/button-delay-time/173/6 "2025-04-01T14:06:14Z")

</div>

This code helped me a lot!

I tried many other codes, but they never worked because my video was hosted at VTurb, so I needed to embed it to the page. This is the right one, thanks!
