ryan_brwn Posted June 21, 2023 Share Posted June 21, 2023 Hello all! Having trouble understanding why something is happening. So I have a minimal demo with timeline that is set to repeat and also has a nested timeline. Expected Result The box moves down, and then to the right in the main timeline (with a repeat set to the timeline) and then in the nested timeline the box scales and changes background colors twice. I would expect the timeline to then repeat this entire sequence in order.Actual Result It seems like the repeat set on the main timeline doesn't consider the nested timeline. Also curiously, the full nested timeline doesn't seem to play out fully. It seems as though the repeat is causing the two timelines to conflict. Question Do repeats set on timelines with nested timelines account for the nested timeline durations/tweens/etc? What is going on and is there a way to get the expected result? Thanks so much!! See the Pen mdQEZbB?editors=0010 by ryankbrown (@ryankbrown) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted June 21, 2023 Share Posted June 21, 2023 Heya! So, taking a look and this looks to be a JS/syntax thing. // this calls the function immediately on load ands adds the returned value .add(nestedTimeline()) // this just calls the function, it's not adding the result of the function to the tl .add(nestedTimeline1) See the Pen vYQXgGJ?editors=0011 by GreenSock (@GreenSock) on CodePen I've added some logs in here for you so you can see what's happening, but you're currently just calling the function, it's not actually adding anything to the timeline. 4 Link to comment Share on other sites More sharing options...
ryan_brwn Posted June 21, 2023 Author Share Posted June 21, 2023 Ahh brilliant! Understood! Thank you so much! 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