Skip to content

Instantly share code, notes, and snippets.

@LiamChapman
Created May 7, 2014 08:34
Show Gist options
  • Select an option

  • Save LiamChapman/8464106af100214864a9 to your computer and use it in GitHub Desktop.

Select an option

Save LiamChapman/8464106af100214864a9 to your computer and use it in GitHub Desktop.
Little JS / jQuery function for adding classes with a delay for animations.
function cssEachAnimate(items, animation_name, delay) {
items.each(function (i) {
var item = $(this);
setTimeout(function () {
item.addClass(animation_name)
}, delay * i);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment