ligr
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by ligr
-
-
Disregard, our production build had type checking disabled and that allowed some missing TimelineMax errors to sneak through.
-
On 12/16/2020 at 5:25 AM, OSUblake said:
GSAP will be global during development, so that could be why. Once you do a production build, the globals go away due to tree shaking. It's working as designed, which might cause problems for module users, but not everyone uses modules.
Is there any recommended workaround to this for module users? -
Thanks!
That hidden helper seems to have done the trick.
Am I wrong in thinking the below modifications also mean you get the benefits of lag smoothing when the page is visible?
function tickGSAPWhileHidden(value) { if (value === false) { document.removeEventListener("visibilitychange", tickGSAPWhileHidden.fn); return clearInterval(tickGSAPWhileHidden.id); } const onChange = () => { clearInterval(tickGSAPWhileHidden.id); document.hidden && (tickGSAPWhileHidden.id = setInterval(() => { gsap.ticker.lagSmoothing(0) gsap.ticker.tick() }, 100)); !document.hidden && gsap.ticker.lagSmoothing(400, 40) }; document.addEventListener("visibilitychange", onChange); tickGSAPWhileHidden.fn = onChange; onChange(); // in case the document is currently hidden. }
-
I implemented this suggestion here in version 2 .
QuoteA fancy solution would be to write your own script so that while the tab is active, you have lagSmoothing() enabled and the ticker uses requestAnimationFrame, but then when the user switches tabs, you turn off lagSmoothing()
This seems to not working using gsap.ticker.lastSmoothing(0) or // or false or 0 ,0.
Is this not supported in version 3?
useRAF and lagSmoothing on gsap object
in GSAP
Posted
Yep, thank you.