Jump to content
Search Community

Order with callbacks and animations

sharok test
Moderator Tag

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I have two situations.

First. For example, we have the following code:

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.

 

Second situation almost the same:

timeline.addCallback(playAudio, 0 ["1.mp3"])); 
timeline.addCallback(anotherCallback, 0)); 
timeline.to(another animation);

I need to run `another animation` only when all callbacks are finished. 

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...