momo12 Posted September 29, 2022 Share Posted September 29, 2022 Guys, I have this code. How can I revert the animation to its original state on LeaveBack? See the Pen RwyMgxj by talewoy290 (@talewoy290) on CodePen Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted September 30, 2022 Solution Share Posted September 30, 2022 Hi, You weren't too far from it actually. All you were missing is check if the element was reparented or not and restore it to it's original parent element: See the Pen yLjKPEm by GreenSock (@GreenSock) on CodePen Hopefully this is what you were looking for. Happy Tweening! 2 Link to comment Share on other sites More sharing options...
momo12 Posted September 30, 2022 Author Share Posted September 30, 2022 8 minutes ago, Rodrigo said: Hi, You weren't too far from it actually. All you were missing is check if the element was reparented or not and restore it to it's original parent element: Hopefully this is what you were looking for. Happy Tweening! Thanks a lot for the tip! Link to comment Share on other sites More sharing options...
GreenSock Posted September 30, 2022 Share Posted September 30, 2022 Yep, and here's one other approach: See the Pen KKRoyxj?editors=0010 by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
momo12 Posted September 30, 2022 Author Share Posted September 30, 2022 12 minutes ago, GreenSock said: Yep, and here's one other approach: Amazing! Thank you Link to comment Share on other sites More sharing options...
momo12 Posted September 30, 2022 Author Share Posted September 30, 2022 Thank you guys @GreenSock @Rodrigo Wish I was asking for a Ferrari! Maybe, you know the cheat code to get one 😂😂😂 1 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