Manvel Posted February 12, 2023 Share Posted February 12, 2023 I needed to make sure that the text and video run synchronously and simultaneously, so I decided to do this. The script starts working only when the video starts to go. Everything works fine, but when you go to another tab, then back to the site, the script starts to work strangely and the text starts to print strangely. See the Pen rNZBVRa by Undefend (@Undefend) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted February 12, 2023 Share Posted February 12, 2023 Browsers throttle requestAnimationFrame() and setTimeout() while a tab is inactive. GSAP automatically adjusts its timing mechanism to adjust things to pick up smoothly where they left off when there's a lag like that (typically a very helpful thing), but it sounds like in your particular scenario you don't want that. You can disable it like: gsap.ticker.lagSmoothing(false); See https://greensock.com/docs/v3/GSAP/gsap.ticker Does that help? Link to comment Share on other sites More sharing options...
Manvel Posted February 13, 2023 Author Share Posted February 13, 2023 16 hours ago, GreenSock said: Browsers throttle requestAnimationFrame() and setTimeout() while a tab is inactive. GSAP automatically adjusts its timing mechanism to adjust things to pick up smoothly where they left off when there's a lag like that (typically a very helpful thing), but it sounds like in your particular scenario you don't want that. You can disable it like: gsap.ticker.lagSmoothing(false); See https://greensock.com/docs/v3/GSAP/gsap.ticker Does that help? No( Link to comment Share on other sites More sharing options...
GreenSock Posted February 14, 2023 Share Posted February 14, 2023 Sorry, but I have no way of seeing or understanding what you think the problem is. Can you please be very specific about exactly how to reproduce the problem? I can't read the language you used there and I don't know what to look for. Maybe try to post a different minimal demo that simply has some colors that change or numeric values that are easy to reference and then specify the steps to reproduce the issue. 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