Share Posted August 21, 2020 Hello everyone, I searched the forum and could not find it. Can I use these methods useRAF() and lagSmoothing() on a gsap object. I saw use-cases on tweens and timelines that developers use useRAF() and lagSmoothing(),but i need on gasp object. I am new to GSAP animations, any help is appreciated. The problem is next: When i switch tab my animation stops, and i don't want that. I want to run without drop of frames in that tab. I have created my animation over gsap object like this : this.spinAnimation = gsap.to(".spinner", { rotation: "+=" + this.animationSettings.normalVelocity * 1000, duration: 1000, repeat: -1, ease: "none", }); Link to post Share on other sites
Share Posted August 21, 2020 Hey Factory WW and welcome. Thanks for supporting GreenSock by being a Club GreenSock member! I'm not sure i'm understanding your issue. Why do you need to turn lag smoothing off or set use RAF to false? You can turn off lag smoothing by using gsap.ticker.lagSmoothing(false); but this is not recommended. 1 Link to post Share on other sites
Share Posted August 21, 2020 9 hours ago, FactoryWW said: When i switch tab my animation stops, and i don't want that. I want to run without drop of frames in that tab. That's generally considered a big "no-no" in the industry, and quite rude to the end user because it needlessly eats up CPU resources and drains battery even though the user can't see anything happening. Also, browsers throttle back their requestAnimationFrame and setTimeout() calls when a tab is inactive - it's not something GSAP does. I cannot imagine a scenario where it would be a good idea to force things to update 60 times per second while a tab is inactive. Like Zach, I'm very curious about WHY you want to do this. I'd strongly recommend against it. 2 Link to post Share on other sites
Author Share Posted August 26, 2020 ZachSaucier and GreenSock thank you. You are right it's bad idea to force inactive tab to update 60fps. I changed my logic so now based on some parameters I calculate where the animation should be when user returns to the page. Thank you for all your time. Link to post Share on other sites