Animation Cancels Out If Reintroduced
Hello, I'm trying to reintroduce an animation, but once I've run the animation the first time, the second time it does not work.
The idea is two boxes, both using either the fadeOut or fadeIn with a Javascript trigger 'click'.
Box1 has a button that fades Box1 out and up, while also fading a Box2 in and up. Box2 has a button that fades Box2 out and down, while also fading Box1 back in and down.
All good so far, but when i try to repeat the animation, now that Box1 is back, when I click the button in Box1, it does not repeat the sequence, it does nothing, just stays there inactive.
I've saved my example on JSFiddel: http://jsfiddle.net/qh540288/
Your help is sincerely appreciated.
here is working example http://jsfiddle.net/1ybuaerj/
Before you try to "retrigger" event you need to remove old classes
Hello, thank you for such a quick response. It is greatly appreciated. I'm already trying to make sense of the sample you created for me.
So how can I handle the same issue with even more boxes in between? Imagine say...
Box1 Box2 Box3 Box4 (and if you click on a link in Box4, you animate Box1 back in, buuuuut once that is done, if you click on a link in Box1 it goes down the original order and animates Box2)
I've updated the JSFiddle sample: http://jsfiddle.net/qh540288/1/
You just need to find the reverse animation effect for this. Just remove the class. And add class again for this because we are not using repeat animation here.
So keep it easy.
Mehul Joshi On 06-Feb-2015 6:46 AM, "RESSDesign" [email protected] wrote:
Hello, thank you for such a quick response. It is greatly appreciated. I'm already trying to make sense of the sample you created for me.
So how can I handle the same issue with even more boxes in between? Imagine say...
Box1 Box2 Box3 Box4 (and if you click on a link in Box4, you animate Box1 back in, buuuuut once that is done, if you click on a link in Box1 it goes down the original order and animates Box2)
I've updated the JSFiddle sample: http://jsfiddle.net/qh540288/1/
— Reply to this email directly or view it on GitHub https://github.com/daneden/animate.css/issues/351#issuecomment-73164235.
Hello Mehul, thank you for the quick response, but unfortunately, I'm not quite figuring out how to implement. I understand the logic being to remove and add back in the class, and it would cause the animation to "fire", but does that mean I do so for all the boxes? Just the bottom one? Both the top and bottom?
I'm doing variations, but I'm not getting it to work.
http://jsfiddle.net/qh540288/1/
Here is how i would do that. You just simply remove all "animation" classes and then add what you want.
http://jsfiddle.net/pou1bp78/
Hope it is what are you looking for
Of course you can do it by more complex way, this is just the simpliest way to do it
Thank you again for a quick response, and a very helpful one. This is what I was looking for and it is helping me understand the logic of what is happening when I remove and add the classes when needed.
Much appreciated. Thank you again.