payne199 Posted June 24, 2022 Share Posted June 24, 2022 I am displaying a simple timeline in which a question is presented, followed by the answer, followed by both the question and answer text disappearing. The idea is to loop through a series of questions and answers in this way. I am throwing the function an array of arrays and using a forEach loop to run through each individual array to make this happen. I see in the console that the loop is looping as desired, but only the final array is animating on the screen, rather than taking the time to run each array. What am I missing? See the Pen dydxKvw by don199 (@don199) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted June 24, 2022 Share Posted June 24, 2022 Hey there! Are you maybe looking for something like this? See the Pen ExQqejP?editors=0011 by GreenSock (@GreenSock) on CodePen You were creating three timelines, all of these were playing at the same time and each transition was at an absolute time in seconds. I've moved the timeline out of the loop, changed the times to relative and then each loop I'm adding new tweens on to the end of the global timeline in order to sequence them. You can also use gsap.set() instead of 'to' tweens - it's essentially a zero duration 'to' tween. Hope this helps. 3 Link to comment Share on other sites More sharing options...
payne199 Posted June 25, 2022 Author Share Posted June 25, 2022 Wow! Thank you for the education 🙂 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