I encapsulate a simple JS animation myself. I want to play the animation when the element is displayed, and hide it again and then play it again, that is, execute the animation again.
all I can think of right now is to add a special class name to this animated dom, and then use a timer to listen to whether the display of such elements is none.
is there a better way than that?