1.0.0 • Published 7 years ago

class-looper v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

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-looper

Yarn

yarn add class-looper

Bower

bower install class-looper

Usage

$('slider-container slider-slide').classLooper({ ... });

Options

SettingTypeDefaultDescription
fulldurationstring or integernullDefine the duration of the entire loop, instead of an individual loop duration. If this is set, the duration setting will be ignored.
durationinteger2Set the length of time a single loop should last (in seconds).
firststring or integercurrent entry IDDefine what number element the loop will start form.
delayinteger or booleanfalseSet a delay (in seconds) for when the initial loop should begin.
loopintegerinfiniteSet the amount of times to loop through the array of elements
reversebooleanfalseSetting this to true will reverse the direction of the loop
classstring'current'Choose what class name should be applied to the currently looping element.