wtc-controller-carousel
v2.0.4
Published
Infinite sliding carousel. Example on [Codepen](https://codepen.io/team/wtc/pen/f3f6619570dd0ef1925893509e2c2504).
Downloads
174
Readme
wtc-controller-carousel
Infinite sliding carousel. Example on Codepen.
Usage
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"));
Examples
Pausing
myCarousel.paused = true;
Changing speed
myCarousel.speed = 4;