Is there a way to use JavaScript to determine when an animation is 75% complete? I have many nested HTML elements that need to be animated with an animation delay property, where the nested animation should start when the parent element is 75% complete. I am familiar with the animationend event, but that's not quite what I'm looking for. You can view the example here.
HTML:
<div>
<p>hello world</p>
</div>
Animation delay code:
div p {
line-height: 200px;
text-align: center;
-webkit-animation-name: icon-bounce-in;
-moz-animation-name: icon-bounce-in;
-o-animation-name: icon-bounce-in;
animation-name: icon-bounce-in;
-webkit-animation-duration: .5s;
-moz-animation-duration: .5s;
-o-animation-duration: .5s;
animation-duration: .5s;
-webkit-animation-delay: .375s;
-moz-animation-delay: .375s;
-o-animation-delay: .375s;
animation-delay: .375s;
}
In this visual example, I've manually delayed the execution of the p
animation by 75%. How would I achieve this programmatically in JavaScript for a large number of elements (not necessarily by adding an animation delay to child elements, but by determining when the parent element is 75% into its animation and triggering the child element's animation)?