pragdave Posted February 18, 2020 Share Posted February 18, 2020 First of all, let me just say that after just a few days of playing, I’m really impressed at how well you guys have crafted this library. Very nicely thought out. So, I’d like to be able to create a timeline which contains animations I’ll be running later. That timeline needs to pause at times and then be resumed. I create a timeline with {paused: true}, and then populate it. However, if I try to add a pause to that timeline (using tl.pause()) it doesn’t become part of the timeline itself. Instead it commands the timeline itself to pause (which it already is). The Codepen shows a simple case of this, creating a paused timeline, adding an animation, a pause, and an animation. When I kick the timeline off, it runs to completion. Is there a trick that lets me add the pause to the actual timeline sequence? Cheers Dave See the Pen JjdKYwJ by pragdave (@pragdave) on CodePen 1 Link to comment Share on other sites More sharing options...
Carl Posted February 18, 2020 Share Posted February 18, 2020 There is an addPause() method that inserts a pause at specific time as explained here https://www.snorkl.tv/greensock-timeline-navigation-with-addpause/ If you you simply want the second tween to start later you can use the position parameter as explained here 4 Link to comment Share on other sites More sharing options...
Carl Posted February 18, 2020 Share Posted February 18, 2020 With the position parameter use tl.to("p", {color: "#800", fontSize: "12pt", duration: 1}, “+=2”) whick will start the animation 2 seconds after the previous tween. 2 Link to comment Share on other sites More sharing options...
pragdave Posted February 18, 2020 Author Share Posted February 18, 2020 I don't know how I missed `addPause()`. Just what I was looking for. I needed to suspend an animation at certain points until an external event occurs, and that does just what I want. Thanks 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