Close lightbox after a couple of seconds

Hi,

I want to make a upload button on my website that will open up a lightbox. In this lightbox, there is a loading GIF. I want to automatically close the lightbox after 5 seconds and then automatically submit the form. So it looks like this:


Can anyone help me with this?

In the first box should be: the user clicks the ”Submit” button, because the form wil be submitted when the lightbox closes.

Hi,
Everything you need can be done using https://www.wix.com/code/reference/wix-window.lightbox.html

Thank you so much! I looked at it. But how can I close the lightbox after 5 seconds? I can only close the lightbox with: close()

Hey Rick, did you find a way to do what you wanted? If you did, how did you do it?

@cajuluokeke You would use some code in the lightbox along the lines of :

import wixWindow from 'wix-window';

$w.onReady(function() {
    setTimeout(function() {wixWindow.lightbox.close()}, 50000);
} );

it worked for me the code thxxxx