0
Can I reply a animation by this type of coding below in description ?
function play(){var m=document.getElementById("figur"); m.style.animation="shown 5s "} function replay(){ var m=document.getElementById("figur"); m.style.animation="shown 5s " } //My image's id is figur and I make a animation by the name "shown" in css using @keyframs....I call the play() and reply () function with onclick event property ,play() works but reply () not ,why?
1 Antwort
+ 2
because you didn't change animation value.
there are several options for animating elements by JavaScript
such as Animation API
https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API