one77 Posted May 21, 2022 Share Posted May 21, 2022 Good day everyone, please you all should bear with me on this one, am still a gsap newbie. i have multiple animations going on some simultaneously on my onboarding page, but i noticed it places alot of load on my pc. currently i stop some objects from animting by setting their opacity to zero which i think doesnt stop the animation in the background. so please how do i stop an aniamtion especially when its done. See the Pen KKQqGgW by Eraloop (@Eraloop) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted May 21, 2022 Share Posted May 21, 2022 That's correct - setting opacity to 0 on an element won't suddenly stop all of its animations. The simplest way to stop all the animations for those particular elements would probably be: gsap.killTweensOf(".box"); Or you can save each tween (as variables or in an Array) and call .kill() on each one individually. I think you could simplify things a bit, like this (click to kill): See the Pen mdXwzGe?editors=0010 by GreenSock (@GreenSock) on CodePen Have fun! 2 Link to comment Share on other sites More sharing options...
one77 Posted May 22, 2022 Author Share Posted May 22, 2022 @GreenSock Thanks somuch 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