This package has been deprecated

Author message:

no longer utilizing this module

properjs-stagger

0.2.1 • Public • Published

Stagger

A stepped timeout manager.

Installation

npm install properjs-stagger --save-dev

Usage

This is a nice utility for staggering animations in sequence.

var Stagger = require( "properjs-stagger" );
var elements = document.querySelectorAll( ".js-anim" );
var stagger = new Stagger({
    // How many iterations to run
    steps: 10,
    // How long to timeout between each one
    delay: 100
 
})
.step(function ( i ) {
    // Do something on each step
    // i === current step number
 
    // For instance, animate via a className
    elements[ i ].className = "is-active";
})
.when( 5, function () {
    // Do something on a specific step
    // In this case, on the 5th step iteration
})
.done(function () {
    // Do something when the iterations end
});
 
// Start the step iterations
stagger.start();
 
// Pause the iterations
stagger.pause();
 
// Resume the iterations
stagger.play();

Dependents (0)

Package Sidebar

Install

npm i properjs-stagger

Weekly Downloads

0

Version

0.2.1

License

none

Last publish

Collaborators

  • kitajchuk