Set Background of Lightbox using code

Hi,

does anyone know how to access and set the background information of a Lightbox using code? Cannot find any documentation but you can set a background using the Editor. But changing it using Wix Code would be fantastic.

Thanks!
Thomas

Hi Tom,
Currently there is no way of doing that. You can submit a feature request here .

In the meantime, consider using a shape or an image that will be at the exact size of the lightbox, covering all of it.
Set it to be at the back of the page and hidden by default, and then use code to show it.

Hope this helps,
Liran.

Thanks Liran for your suggestion. I tried with an image, but how do I dynamically change the dimensions of the IMG-element when the viewport changes its size? The size of the viewport I’m using designing the Lightbox and placing the image isn’t necessarily the same as the user has. Thus the Lightbox fits its size dynamically to the size of the viewport. But the image inside? It has fixed dimensions…

Tom,
I tried it here (https://lopezblog.wixsite.com/omstaff/Expeditions/Argentina/August-1-Argentina), you have to hide the dataset left panel and stretch the picture (after its attached to the strip) all the way to the left until you see the edge turn orange (I think it’s the right color), and then do the same on the right, top and bottom. Then anytime the screen changes the image changes with it. M