Share Posted June 29, 2017 Hey guys, I want to pause the timeline when it's completed. tl = new TimelineMax({repeat: -1, paused: true}); tl .to(dummy, 0.5, {x: '+=60', ease:Power3.easeOut}, 0.5) .addPause() .to(dummy, 0.5, {x: '-=60', ease:Power3.easeOut}, 1.5) .addPause(); The first addPause() works, the one at the end doesn't effect the timeline at all. The timeline is paused on load, a click on a button starts it. It pauses on the first addPause, a buttons starts it again but it doesn't pause on the last addPause. I hope it's somehow clear what I'm trying to achieve I'm thankful for any help. See the Pen bRaZLd by anon (@anon) on CodePen Link to comment Share on other sites More sharing options...
Author Share Posted June 29, 2017 Okay I don't know if this is the right way to do it, but I solved the problem via a simple function: function pauseLeft() { tl.pause(); } var dummy = document.getElementById('dummy'); tl = new TimelineMax({repeat: -1, paused: true}); tl .to(dummy, 0.5, {x: '+=60', ease:Power3.easeOut, onComplete:pauseLeft}, 0.5) .to(dummy, 0.5, {x: '-=60', ease:Power3.easeOut, onComplete:pauseLeft}, 1.5); Thanks anyway Link to comment Share on other sites More sharing options...
Share Posted June 29, 2017 Hi hallibus, Welcome to GreenSock Forums. This could be an alternative: See the Pen BZJXKL by mikeK (@mikeK) on CodePen Happy tweening ... Link to comment Share on other sites More sharing options...
Share Posted June 30, 2017 Thanks for pointing that out. This should be fixed in 1.20.1 (out now). 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