Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
How to add settings to lightGallery

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();
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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...

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!