Capítulo 300 de 411

Chapter 300: Observer.getById

Core Idea

The Observer instance with the matching id that was defined in the configuration vars object (or undefined if no matching ScrollTriggers are found)

Key Concepts

  • id: String

Code Examples

Observer.create({
  id: "my-id",
  ...
});

// then later...
let observer = Observer.getById("my-id");
  • What it demonstrates: typical usage of Observer.getById in a GSAP animation.

Key Takeaways

  1. id: String