Preloader using lightbox

I would like to use a lightbox as a preloader, currently the lightbox is opened onLoad, and the page code is loading data from a 3rd party service, and once it loads, I wish it to close the lightbox.

how will you call to close the lightbox from the code on the page that indicates all data is loaded?

Thanks

Hi Itamar,
How do you know that the loading from a 3rd party is done ?
In order to close a lightbox you can use wixWindow.lightbox.close method from the lightbox.
Roi

The data I’m loading is from my aws instance.
In the code page it loads the data and I wish it to close the lightbox once it’s finish.

Can I use the close method from the page code and not from the light box? Or you have other suggestion how can it be done?

It is not possible to close the lightbox from other page, only from the lightbox it self.
How about loading the data from the lightbox and close it when it’s done ?
Roi