Is it possible to have several galleries on one page using setElements vs divs in the html? #563
-
|
I apologize in advance for asking this question directly on GitHub. I've been searching for an answer for two days now on the GitHub discussions, then StackOverflow, CodePen, CodeSandbox, Reddit, Google and more. No luck. I tried myGallery1, myGallery2, etc. But that did not work. I also tried: But I think that selector and elements are exclusive of each other? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hey there @mGumberson To make multiple galleries you would do like you have in the last example, but with the Here's a pen that demonstrates what I mean: https://codepen.io/gingerchew/pen/XJJQBdg/87dc29ec16a655ef1b09ceed1c235756?editors=0010 Instead of looking for a selector, you just have multiple "instances" of GLightbox, each one in charge of controlling a single gallery. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
|
Brilliant! Thank you @gingerchew! Then: I don't doubt that there is a more elegant solution than to simply list each sequential image file; but I only had four for each gallery. |
Beta Was this translation helpful? Give feedback.
Hey there @mGumberson
To make multiple galleries you would do like you have in the last example, but with the
elementsproperty.Here's a pen that demonstrates what I mean: https://codepen.io/gingerchew/pen/XJJQBdg/87dc29ec16a655ef1b09ceed1c235756?editors=0010
Instead of looking for a selector, you just have multiple "instances" of GLightbox, each one in charge of controlling a single gallery.
Hope that helps!