Adding a delay for a lightbox on Velo code

Hello, sorry if I’m about to ask a question that’s already been answered, but I can’t seem to find after searching for a bit.
My question is the next one - Can someone please tell me if it’s possible to add an “x” seconds delay for the following lightbox opening script in Velo?

import wixWindow from 'wix-window';  

$w.onReady(function ()  {

var today = newDate();
var day = today.getDay();
if(day === 3)         
	wixWindow.openLightbox("Lightbox Name")
});

Thank you! :grinning:

let delayTime = 500; // <------- milliseconds
setTimeOut(()=>{
    //your code here ....
},delayTime);

Thank you so much and apologies for the late reply! Also are there programming languages I should learn that would enable me to apply it on velo?
Where should I start if I want to become proficient with Velo like you?
Again thank you so much! :grinning:

Hello again.

There are different ways of how to learn JavaScript.

  1. Taking a learning-course ($$$).
    This method will push you very quickly to a higher programming level, but this way of learning is not detailed.
  2. Reading a book ($).
    This way of learning is not that fast like a learning-course, but more detailed.
  3. Learning by doing (free).
    This way of learning is the most detailed, but also the most time-intensive.
    You will get your first results after about 6-month of self-learning.
    You will understand more and more (step-by-step) by CODE-REPLICATIONS.
    But your understandment will be more detailed, because you will be confronted with all the existing problems of a programming language immediately and almost at once.
    It will be definetely the most difficult way to learn, but if you are durable enough and you will stay your line, maybe in future we will see a new coder on the horizont, who knows.

What else you could learn to expand your CODING SKILLS ???
-HTML
-CSS
-JQuery
-VBA
and surely some more…

Why VBA?
You could use VBA to connect VELO with Microsoft-Excel’s BACKGROUND-CODING-LANGUAGE for example.

There are surely much more options, all you have to do is to search for all the options in the world-wide-web.

The more interest you will have to learn something, the more you will learn at the end.

And remember → A GOOD CODER NEVER GIVES UP !!!
:wink:

Thank you so much for the detailed comment! I’m definitely interested in learning and your comment gave me the info and momentum necessary to start! :medal_sports:

You can start your learning code-adventure here…
Tutorial-Overview | WixWorld (russian-dima.wixsite.com)

This is just an very old site i used to learn CORVID, now it is called VELO.
A JS-Based programming language used in wix.

Have fun!

If anyone is curious for the end result:

let delayTime = 10000;
setTimeout(()=>{ 
       $w.onReady(function () {

 
        var today = new Date();
        var day = today.getDay();
        if (day === 1)
               wixWindow.openLightbox("Your wix Lightbox")
        if (day === 2)
               wixWindow.openLightbox("Your wix Lightbox")
        if (day === 3)
                wixWindow.openLightbox("Your wix Lightbox")    
        if (day === 4)
               wixWindow.openLightbox("Your wix Lightbox") 
        if (day === 5)
               wixWindow.openLightbox("Your wix Lightbox")
        if (day === 6)
               wixWindow.openLightbox("Your wix Lightbox") 
        if (day === 0)
               wixWindow.openLightbox("Your wix Lightbox")
});
},delayTime);

On delaytime I used 10000 milliseconds which translates to 10 seconds, that’s where you put your timer.


Thank you Velo-Ninja!

What for do you need 2x

$w.onReady(function(){

Your page can get ready just 1x-time only.

Woops, edited! I copy pasted it twice and didn’t delete it fully