P
P
pkring2018-11-15 11:07:01
css
pkring, 2018-11-15 11:07:01

How to run the same css animation?

How to run the same css animation on click? Those. the animation should break and start over. Now it works like this: there are two classes with the same animation and they just change on click depending on the flag. If you just remove the class and immediately add it, then the animation just continues to run without returning to the beginning.
Link to jsfiddle

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2018-11-15
@pkring

X
xtress, 2018-11-15
@xtress

And this one won't work:

function animateActive() {
     video.classList.toggle('animate');
 }

Seems to work the way you want.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question