strawdynamics/luminous

How to open lightbox programmatically

Closed this issue · 1 comments

As the title says for example I have

new LuminousGallery(
            document.querySelectorAll(".jsProjectLightbox"),
            {
              arrowNavigation: true,
            }
          );

and I cannot find in documentation what is method to open it manually

Hi @marko-mlinarevic, apologies for taking a while to respond to this. Here is what I would suggest:

var anchors = Array.from(document.querySelectorAll(".jsProjectLightbox"));
var lg2 = new LuminousGallery(
    anchors,
    {
        arrowNavigation: true,
    }
);      

anchors[0].click();

Let me know if this works for you. Thanks!