Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by tristansmn

  1. Thanks for your answer. It's more clear like that. My point is that I want to send the data in another variable when velocity is updated. I don't know if it's possible. Something like that : let scrollVelocity = 0; ScrollTrigger.create({ start: 0, end: () => ScrollTrigger.maxScroll("html"), onUpdate: function(self) { scrollVelocity = self.getVelocity(); } }); let defaultOptions = { loop: true, autoplay: true, speed: scrollVelocity, animationData: animation, };
  2. Hi, I'm just getting started with GSAP and scrollTrigger. I am trying to get the scroll velocity with scroll trigger. I would like to use a var with velocity outside my scrolltrigger instance and show the velocity on the webpage when someone is scrolling. Is there a way to do that ? my code here: let scrollVelocity = 0 ScrollTrigger.create({ trigger: 'body', start: "top top", end: "bottom bottom", markers: true, scrub: 1, onUpdate: function(self) { scrollVelocity = self.getVelocity(); } }); console.log(scrollVelocity)