I'm trying to trigger a CSS animation again with JavaScript. Tried a lot of tricks, nothing works.
Steps:
<canvas class="shake">is added todocument.bodyshakeanimation works!- Press
"Shake"button to re-add the CSS. - Animation does not get triggered again.
Code
https://jsbin.com/pasitic/edit?css,js,console,output
The code is really simple. I'm hoping that there is a really simple and decent solution out there. I'm using vanilla JavaScript.
Update
Solved and the example was updated with the working code.