carousel-test-95
v1.0.0
Published
A class representing a carousel with the ability to cycle between different slides.
Downloads
2
Readme
How to use:
Initialize a carousel instance and pass the constructor the outer wrapper of your carousel.
- This wrapper should have the following css styling
.carousel-outer { display: flex; scroll-behavior: smooth; overflow: hidden; }
The slides of the carousel should have the following css styling
.carousel-slide { width: 100%; }
In order to move to the next and previous slides, you can bind the Carousel.next() and Carousel.previous() methods to dedicated buttons, or make them trigger on an interval timer.
In order to jump to a specific slide, use the Carousle.jump(index) method and pass it the slide you want to jump to.