There are two options for you.
- Transition end events, which can be fired with JavaScript
- Transition delays
Transition end events can be listened for on any element that has a transition. You can fire a function when the transition ends like this:
element.addEventListener( "transitionend", function() {
// run code here to add class on next element
});
You'll have to make sure to add the necessary prefixes, but jQuery can assist. This is easily achieved in a for loop.
The other alternative with no extra JS or transition end events would be to delay the transitions of .c.two and .c.three by the length of the actual transition (and two times that for .c.three). You can add this directly in the CSS by using the transition-delay property on the respective elements.
I hope this helps.
$('.className').on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', doSomething);to detect animation ended or not.