sachinchoolur / lightgallery.js

Full featured JavaScript image & video gallery. No dependencies
https://sachinchoolur.github.io/lightgallery.js/
Other
5.3k stars 596 forks source link

Several galleries on the same page #62

Closed josemgala closed 7 years ago

josemgala commented 7 years ago

I would like to know if it is possible to have several image galleries on the same page at the same time, they would be gallery of few images, about 5 or 6. I have tried with the demo to duplicate the four images and works well with the first four, but with the Next group does not work.

sachinchoolur commented 7 years ago

Hey @josemgala , Yes, it is possible. Here is the demo http://codepen.io/anon/pen/jmmWKJ?editors=1010

josemgala commented 7 years ago

Thanks a lot for the example, but I can not understand why it does not work for me, I'm doing a test on my project and it works nothing more than a single gallery, attached link in case I could review it: http://visiomatica.s1623ed4.alojamientovirtual.com/farmacia.html

sachinchoolur commented 7 years ago

You are using the same id for all galleries. id should be unique in one document. Just change id="lightgallery" to class="lightgallery" and initialize lightGallery using the same class

$('.lightgallery').lightGallery({})

Everything should work fine :)

Don't hesitate to contact me if the issue persists

josemgala commented 7 years ago

Perfect!!!!!! 👍 Thanks a lot!!!!!