Share Posted February 10, 2017 Hi, Trying to wrap the GSAP into a standard interface i bumped into an issue calling .pause() method to several timelines. Please take a look at this fiddle: https://jsfiddle.net/_Ovidiu/x5m690Ld/ 1. From drop-down selelect "Sprite animation" 2. Click "Start Animation" 3. After 3 seconds click "Pause animation" result: The console logs that the timeline is paused but the animation still runs. Please help. Thanks See the Pen by _Ovidiu (@_Ovidiu) on CodePen Link to comment Share on other sites More sharing options...
Share Posted February 10, 2017 Hello! So in your code it only took a second to see you're running .Pause() and .Resume() on the click event of btn2. $('#btn2').click(function(){ Actions[iCurrAction].Pause(); }); $('#btn2').click(function(){ //alert('C'); Actions[iCurrAction].Resume(); }); Both of these run and so the animation pauses then immediately resumes. I'm assuming you want the resume to trigger on the click event of btn3, not btn2 Changing the Resume event trigger to btn3 solved your issue and also made the resume button work $('#btn2').click(function(){ Actions[iCurrAction].Pause(); }); $('#btn3').click(function(){ // changed to #btn3 //alert('C'); Actions[iCurrAction].Resume(); }); 5 Link to comment Share on other sites More sharing options...
Author Share Posted February 10, 2017 Thanks Craig, the second pair of eyes always helps. 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