Infinite sliding carousel. Example on Codepen.
Install wtc-controller-carousel
with npm
.
npm install wtc-controller-carousel
- Add the markup to your template
<div class="carousel">
<div class="carousel__container">
<div class="carousel__item">
<!-- stuff -->
</div>
<div class="carousel__item carousel__item--2">
<!-- stuff 2-->
</div>
</div>
</div>
- Import the css into your project.
@import ~wtc-controller-carousel;
- Import the library into your JS and instanciate it
import Carousel from "wtc-controller-carousel";
const myCarousel = new Carousel(document.querySelector(".carousel"));
myCarousel.paused = true;
myCarousel.speed = 4;