If 1 element has 2 animations, can I set the play-state for each animation individually?
My question is about CSS and animations:
Using only CSS.
If i have one element with two animations, is there a way to set the animation-play-state for each animation individually?
In my project I've made 2 "buttons" and the goal is that each button sets the animation-play-state of one of the two animations that element has.
Thanks!
2 Replies
yea, you can comma seperate them
for example
https://codepen.io/MarkBoots/pen/KwPVpjw
So if you want to do it with js, update the animation-playstate for both.
Andwith the use of custom properties, it makes it even easier
Whoa, THANKS for the answer! and the example! I need to try this, just a comma... and i did not use variables yet in css i'll look into it!
I'm using only html and css for this thing i'm making, I hope i can make it work anyways!