Share Posted July 1, 2022 Hi, how to kill the tween in time line and make it go back the original position? You can try the codepen, let it run finish, press kill button but still nothing happen See the Pen rNdabRX?editors=1111 by ngocducdim (@ngocducdim) on CodePen Link to comment Share on other sites More sharing options...
Share Posted July 1, 2022 Have you seen the docs? There is an .kill() function https://greensock.com/docs/v3/GSAP/Timeline/kill() I would love to know the problem you're facing, because I think there probably is a solution for it, but where are missing the full picture of what it is you want to do. See the Pen KKowORB?editors=1010 by mvaneijgen (@mvaneijgen) on CodePen 1 Link to comment Share on other sites More sharing options...
Author Share Posted July 1, 2022 Hi, thanks for the reply, the kill you mention above is completely kill the whole timeline? My current situation is the timeline will have many tweens (using .to and .from), and I need to edit/remove some of those tweens, but when remove I expect it come back original position but it doesn't, now have found solution that I will use .fromTo(), it more easier to control the tweens in timeline. Thanks for you help Link to comment Share on other sites More sharing options...
Share Posted July 1, 2022 When you kill() a tween, it doesn't revert it to the previous values. It simply stops it immediately in its tracks and makes it eligible for garbage collection. You can rewind it to the starting values if you want: animation.progress(0).kill(); 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