I was used to animate elements using JavaScript. It was easier for me to do this with CSS3.
Using JavaScript, how can you detect when CSS animation started and when it ended? Is there any way?
Bind relevant events to an element, e.g.
el.addEventListener("animationstart", function() {}, false); el.addEventListener("animationend", function() {}, false); el.addEventListener("animationiteration", function() {}, false);
https://developer.mozilla.org/en-US/docs/CSS/Tutorials/Using_CSS_animations#Using_animation_events
Note. You may also need to add the appropriate prefix events, for example.webkitAnimationEnd
webkitAnimationEnd