1.0.0 • Published 9 years ago
class-looper v1.0.0
Class Looper
Apply a class to an element, and have it that class periodically move through an array of elements.
Installation
NPM
npm i class-looperYarn
yarn add class-looperBower
bower install class-looperUsage
$('slider-container slider-slide').classLooper({ ... });Options
| Setting | Type | Default | Description |
|---|---|---|---|
| fullduration | string or integer | null | Define the duration of the entire loop, instead of an individual loop duration. If this is set, the duration setting will be ignored. |
| duration | integer | 2 | Set the length of time a single loop should last (in seconds). |
| first | string or integer | current entry ID | Define what number element the loop will start form. |
| delay | integer or boolean | false | Set a delay (in seconds) for when the initial loop should begin. |
| loop | integer | infinite | Set the amount of times to loop through the array of elements |
| reverse | boolean | false | Setting this to true will reverse the direction of the loop |
| class | string | 'current' | Choose what class name should be applied to the currently looping element. |
1.0.0
9 years ago