Created
May 7, 2014 08:34
-
-
Save LiamChapman/8464106af100214864a9 to your computer and use it in GitHub Desktop.
Little JS / jQuery function for adding classes with a delay for animations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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