Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var isAnimating = false;
- $('.toggle').click(function() {
- //Only run it if it's not animating
- if(!isAnimating) {
- isAnimating = true;
- menu.toggleClass('open');
- item = $('.item');
- $.each($(item), function(i, el) {
- $(el).css({'opacity': 0});
- setTimeout(function() {
- $(el).toggleClass('open').animate({
- 'opacity': 1.0
- }, 450);
- },50 + ( i * 200 ));
- });
- //It just triggers it as many times as there are elements..
- isAnimating = false;
- }
- });
Add Comment
Please, Sign In to add comment