Jump to content
Search Community

tristansmn

Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

tristansmn's Achievements

0

Reputation

  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)
×
×
  • Create New...