Capítulo 316 de 411

Chapter 316: .getVelocity

Core Idea

Returns the current velocity of the smoothed scroll in pixels-per-second

Code Examples

ScrollSmoother.create({
  onUpdate: (self) => console.log("velocity:", self.getVelocity()),
});
  • What it demonstrates: typical usage of .getVelocity in a GSAP animation.

Key Takeaways

  1. Returns the current velocity of the smoothed scroll in pixels-per-second