Take a look at this particular div:
<div id="someid"></div>
Here is its styling:
#someid {
transition: background-color 10s ease;
background-color: #FF0000;
height: 100px;
width: 100px;
}
#someid:hover {
background-color: #FFFFFF;
}
I am interested in being able to determine the state (whether it is currently animating or not) of #someid
using JavaScript, and potentially end the animation if possible. I attempted something similar to the solution provided in this response:
document.querySelector("#someid").style.transition = "none";
However, this did not work for an element that was already in the midst of an animation.
The goal is to be able to identify whether the element is currently animating, and if so, either wait for the animation to finish or halt it immediately, without taking any action if it is not animating.
I have already come across information regarding the transitionend event, but unfortunately it does not provide insight into whether an element is presently animating.