Sequencr jQuery Plugin

This jQuery plugin is great for when you want to animate a set of elements in succession, that is, not all at the same time.

Sorry, but my maths isn’t great and I’m not sure what term to use instead of  modifier for overlapping the animations. If anyone knows, please comment and I’ll sort it out.

Thank you to Alan Neville on Twitter, apparently the term I should be using instead of  modifier is  convolution. I will update the code accordingly!

Click here to jump straight to the minified plugin code.

Animations:

There are no default animations set, you must pass an object literal of animations and their values to the  animations  property.

Animation Time:

Pretty self explanatory, changing the  animationTime  property will change how long each animation will take, in milliseconds. The default is 1000 milliseconds (1 second).

Classes:

You can choose to have classes added to each element after the animation has finished by adding a string to the  classes property.

Delay:

The delay before any animations start, in milliseconds. Changed with the  delay property. The default is 0.

Easing:

The type of easing you want to use, the default is “swing”. Can be used with easing plugins wherever you’d use  easing in a standard jQuery animation.

Convolution:

Previously called the  modifier.

The default setting is to have each element animate once the previous element has finished, but you can change the  convolution value, with 1 being default. Setting convolution:2  will cause the next animation to start when the previous animation is halfway complete, but you can choose any number. The higher the number, the sooner the next animation will start. Choosing  convolution:0 will cause the animations to all fire at the same time.

Time Between:

You can set the time between animations by changing the  timeBetween  property. The default for this is 100, and the value you pass will be in milliseconds.

Example:

Plugin code:

Add this to your jQuery/JS file before any code that uses the plugin: