1.3.1 • Published 5 years ago

transition-rotator v1.3.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

transition-rotator

This just relies on CSS for any transition between items. Every item will be able to be identified in CSS as next, previous or active.

Browsers that don't support CSS transitions still see the end result. caniuse

ES5 polyfills needed for:

  • Array.isArray
  • Array.forEach
  • Array.map
  • Object.keys

To get started

CommonJS

$ npm install transition-rotator
var TransitionRotator = require('transition-rotator');

Browser Global

<script src="iife/transition-rotator.js"></script>

Create a TransitionRotator

var arrayOfItems = Array.prototype.slice.call(document.querySelectorAll('.items'), 0);

// this wouldn't be necessary since all these options are the defaults
var options = {
    next: 'next',
    previous: 'previous',
    active: 'active',
    attribute: 'data-position'
};

var rotator = new TransitionRotator(arrayOfItems, options);

Change the active index

rotator.activate(0);

License

MIT © The C2 Group

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

8 years ago

1.1.0

9 years ago