0

Im using lightGallery to open a lightbox of images using the solution below, which was found here: https://stackoverflow.com/a/54764289/1390648

Where can I add the settings from the lightGallery docs to the code below to control the mode, speed, and other settings?

Each time I try to add them in, it breaks the lightGallery from opening.

function initLightGallery() {
    lightGallery(document.getElementById('lightgallery'));
    $("#magic_start").on("click", () => {
        $("#lightgallery :first-child > img").trigger("click");
    });
}
initLightGallery();
R-G
  • 105
  • 2
  • 14

1 Answers1

2

Replace your second line

lightGallery(document.getElementById('lightgallery'));

by

lightGallery(document.getElementById('lightgallery'), {
    speed: 500,
    mode: 'fade',
    ...Other settings
});

It is right there in the docs...

jasie
  • 2,192
  • 10
  • 39
  • 54