Closed roskad closed 7 months ago
Hi, you are missing the option selector in each configuration, so the script initializes only one time all the items with the class '.venobox', which is the default selector if nothing specific is provided.
Remove the class venobox
from your links, and add custom classes, eg: carousel-1
, carousel-2
, and so on...
const carousel1VenoBoxOptions = {
selector: ".carousel-1",
// more options here
});
const carousel2VenoBoxOptions = {
selector: ".carousel-2",
// more options here
});
@nicolafranchini thank you! Works correctly now.
By the way, the selector property only accepts a single class, right?
The selector accepts any valid queryselector, it could also be something like this: selector: "#my-gallery a"
Is is possible to use multiple VenoBox galleries with different set of options on the same page?
For example, I have multiple carousels on the same page in which I need to use different callbacks. And on the same page I have another section in which I want to use VenoBox but with it's own settings.
When I try this approach:
VenoBox gets settings from the first initialization, in my case
const carousel1VenoBox = new VenoBox(carousel1VenoBoxOptions );
This means I can't configure second (third, etc) VenoBox instance as I need.