So I have a piece of code. The purpose is to play a selected animation from Animate.css on click.
The code
$(".container>parent").click(function () {
$('.element').css({
'animation': 'fadeInUp .2s',
'-webkit-animation': 'fadeInUp .2s'
});
});
The problem
Animation runs, but only one time. 'Infinite' attribute causes chaos :P
What else could I do, to play that animation every single time someone click it?
Thanks for your time.
My HTML:
<span class="parent">
<img src="assets/myimage.png" class="filter-image">
<span class="element">Text</span>
</span>
I want to animate the text everytime I click it.
The animation won't work the second time if you don't remove animation class after the current animation finishes.
Here's a snippet:
usage is simple, just call animate function, like this:
In you case, you said you are using animate.css library:
Live example: jsFiddle