Skip to content
Advertisement

After pressing button the animation does not repeat

What am I doing wrong, that after pressing the button the animation does not repeat? Thanks for help.

JavaScript
JavaScript
JavaScript

Advertisement

Answer

You can use something like this to refresh animation on click.

I added .animation class to separate it from vector class.This way you can easly toggle it.

the setTimeout is to wait a moment before adding the class after removing it.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement