Capítulo 326 de 411

Chapter 326: ScrollSmoother.get

Core Idea

Returns the ScrollSmoother instance (if one has been created). There can only be one instance at any given time.

Code Examples

let smoother = ScrollSmoother.create({...});

// then later, you can get that instance (perhaps in another file) like this:
let previouslyCreatedSmoother = ScrollSmoother.get();
  • What it demonstrates: typical usage of ScrollSmoother.get in a GSAP animation.

Key Takeaways

  1. Returns the ScrollSmoother instance (if one has been created). There can only be one instance at any given time.