You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling with a concept which I think should be more obvious to me.
I get how I might go about toggling a css animation, like for instance: on click of a button fade an element to opacity 0 by binding class opacity-0 then bring it back to full opacity on the next click by toggling the class to opacity-100.
What I'm stumped on though is what if I want to reproduce the same animation on every click, not toggle it. So lets say I have a keyframe animation that goes to opacity-0 and then back to full opacity within the same keyframe animation, if I want to repeat the animation on the next click, I can't do that by toggling a class because the following click will simply remove the class.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm struggling with a concept which I think should be more obvious to me.
I get how I might go about toggling a css animation, like for instance: on click of a button fade an element to opacity 0 by binding class opacity-0 then bring it back to full opacity on the next click by toggling the class to opacity-100.
What I'm stumped on though is what if I want to reproduce the same animation on every click, not toggle it. So lets say I have a keyframe animation that goes to opacity-0 and then back to full opacity within the same keyframe animation, if I want to repeat the animation on the next click, I can't do that by toggling a class because the following click will simply remove the class.
Beta Was this translation helpful? Give feedback.
All reactions