Skip to content

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

Notifications You must be signed in to change notification settings

jrf0110/active-interval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published