void__ Posted June 18, 2021 Share Posted June 18, 2021 Hi all, I am trying to .add() a couple of timelines to a master timeline using labels, but coded out of sequence. Here is a pen of the timeline working correctly when coded in sequence. However, when the nested timelines are added out of sequence (assume they will be added in a separate js file), it does not function as expected. Maybe my understanding of how labels work is incorrect? Any help would be appreciated. 👍 Not working See the Pen mdWoaRM by brioenzswozlle (@brioenzswozlle) on CodePen Working See the Pen XWMGyOG by brioenzswozlle (@brioenzswozlle) on CodePen Link to comment Share on other sites More sharing options...
OSUblake Posted June 18, 2021 Share Posted June 18, 2021 Hi void! You can add animations wherever you want, and at any time, but if a label doesn't exists, it's going to get added to the end of the timeline. Your timeline is empty, so the outro label is at the same position as the intro label. You can verify the label times. tlMaster.addLabel('intro') tlMaster.addPause(">") tlMaster.addLabel('outro') console.log(tlMaster.labels); 2 Link to comment Share on other sites More sharing options...
OSUblake Posted June 18, 2021 Share Posted June 18, 2021 I believe you are expecting the labels to behave like the shiftChildren method. https://greensock.com/docs/v3/GSAP/Timeline/shiftChildren() 1 Link to comment Share on other sites More sharing options...
void__ Posted June 24, 2021 Author Share Posted June 24, 2021 Thank you, shiftChildren is exactly what I was looking for. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now