Simple, responsive, slider for cards using vanilla js.
- Include code below where the gallery should be.
<div id="container">
<div class="card card_1"></div>
<div class="card card_2"></div>
<div class="card card_3"></div>
<div class="card card_4"></div>
<div class="card card_5"></div>
<div class="card card_6"></div>
</div>
- Change index.css file for your needs.
- In js file, there is a config object where you can set your different values such as:
activeCardIndex
- it's index of initially active card(expected value: number).transition
- it's transition that will be assigned to each card(expected value: string). Example:"flex 500ms ease-in-out"
.
Demo: https://salihub.github.io/Gallery-cards-slider/index.html