Jump to content
Search Community

Tblax

Members
  • Posts

    2
  • Joined

  • Last visited

Tblax's Achievements

  1. Thanks @GreenSock It helps a lot. As for the reason I do not precalculate, I guess it's because I rely on getVelocity() in other parts of my code where the sampling is good enough for those other purposes and I didn't even think about using something else, that's my obsessive tendencies I guess 🙂
  2. Hi everyone, I'm struggling to obtain consistent and predictable values from a ScrollTrigger instance .getVelocity() method, in order to compute the remaining time to any given element(s) within the scrolling parent element. This scrollTrigger instance is driven by a scrollTotween, as I need the scrolling to be programatically driven within the app I'm building. For this reason and quite a few others, I would strongly prefer to keep a scrolling approach rather than using transforms, as scrolling serves a multitude of purposes throughout the rest of the app. As you can see in the demo below, even though the scrollTo tween speed is constant with no easing whatsoever, I'm getting highly "instable" values from the getVelocity instance method within the onUpdate callback (the delta between two values can amount to pretty crazy numbers!) My guess is all of this is related to the browsers inherent native scrolling behavior but that's just, well, a guess. How would you go about solving or working around this issue? All solutions are welcome and thank you in advance! https://codepen.io/Lorbakounet/pen/VwNGvzm
×
×
  • Create New...