There are a couple of options available to you.
- You can utilize transition end events, which can be triggered with JavaScript.
- An alternative option is to incorporate transition delays.
You can listen for transition end events on any element that has a transition. To execute a function once the transition has ended, you can do the following:
element.addEventListener( "transitionend", function() {
// Insert code here to add a class to the next element
});
It is important to remember to include any necessary prefixes, but jQuery can simplify this process. You can easily accomplish this by using a for
loop.
Another approach, which does not require additional JavaScript or transition end events, involves delaying the transitions of .c.two
and .c.three
by the duration of the actual transition (and double that for .c.three
). This can be implemented directly in the CSS by utilizing the transition-delay
property on the corresponding elements.
I trust this information proves beneficial to you.