Skip to content

stagas/infinite-carousel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

infinite-carousel

component-install stagas/infinite-carousel

Usage

<div id="my-carousel">
  <ul>
    <li>Item 1
    <li>Item 2
  </ul>
</div>
var Carousel = require('infinite-carousel');

var el = document.getElementById('my-carousel');
var carousel = Carousel(el);

API

carousel.next()

Show next item.

carousel.prev()

Show previous item.

Protip

For a slide effect use this in your css:

.carousel li {
  transition: .4s all ease;
  -webkit-transition: .4s all ease;
  -moz-transition: .4s all ease;
  -o-transition: .4s all ease;
}

Credits

This is a modified version of tomerdmnt/carousel (MIT)

Licence

MIT