Skip to content

heinpen/Gallery-cards-slider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Simple, responsive, slider for cards using vanilla js.

Usage

  1. 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>
  1. Change index.css file for your needs.
  2. 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

License

MIT