var timeline = new TimelineMax();
timeline.to(elem, 1, {css: {boxShadow: '0 0 40px 40px red'}});
timeline.addCallback(playAudio, 0 ["1.mp3"])) // play audio at begining
timeline.to(another animation)
This code starts animation and plays audio. And, I don't know the duration of audio. I need to run `another animation` animation when first animation is completed and callback is completed too. Now it starts when first animation is completed.
Order with callbacks and animations
in GSAP
Posted
I have two situations.
First. For example, we have the following code:
This code starts animation and plays audio. And, I don't know the duration of audio. I need to run `another animation` animation when first animation is completed and callback is completed too. Now it starts when first animation is completed.
Second situation almost the same:
I need to run `another animation` only when all callbacks are finished.