Skip to content
Applies an `active` class to a set of elements one at a time at a specific interval.
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Gruntfile.js
README.md
bower.json
package.json

README.md

jQuery Active Class Rotator

Applies an active class to a set of elements one at a time at a specific interval.

Usage

var savingsInterval = $('.my-sayings > li').activeInterval({
  interval: 3000
}).start();

Install

bower install jquery.active-rotator

Documentation

Options:

// Defaults
{
  // Time between each tick
  interval:       5000
  // Class name to use for active element
, className:      'active'
  // Class name to use for the next active element
, upNext:         'up-next'
  // Before the class change occurs
, onTickBefore:   function( interval ){}
  // As the class change occurs
, onRotate:       function( $el, interval ){}
};

The plugin returns an interface for handling the rotation.

start()

Starts the interval.

stop()

Stops the interval.

go( index )

Go to a specific position

next()

Got to the previous position

prev()

Got to the next position

You can’t perform that action at this time.