Unknown number of multi-carousel #274
Unanswered
colormango
asked this question in
Q&A
Replies: 1 comment
-
Hi, Here is one possible solution: [...document.querySelectorAll(".carousel")].forEach((el) => {
const myCarousel = new Carousel(el, {
// Options
});
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to display an unknown number of carousels on my page, how should I solve it?
const myCarousel1 = new Carousel(document.querySelector("#list-item-carousel1"), {friction: 0.8,});
const myCarousel2 = new Carousel(document.querySelector("#list-item-carousel2"), {friction: 0.8,});
...
...
Beta Was this translation helpful? Give feedback.
All reactions