Simple but slick carousel that works with mouse, touch and trackpad events.
npm install ds-carousel
`
index.js
`
import Carousel from 'ds-carousel';
const slides = document.querySelector('#slides');
const carousel = new Carousel(slides);
`
In this example, we'll create an empty DS-Carousel and then fill it using a for loop. This method might be better suited for procedurally generated carousels:
index.js
`
import Carousel from 'ds-carousel';
const carousel = new Carousel();
for (let i = 0; i < 3; i += 1) {
const slide = document.createElement('div');
slide.innerHTML = ;
carousel.addSlide(slide);
}
document.body.appendChild(carousel.el);
``