Capítulo 339 de 411

Chapter 339: .isActive

Core Idea

[read-only] Only true if the scroll position is between the start and end positions of the ScrollTrigger instance.

Code Examples

ScrollTrigger.create({
  trigger: ".trigger",
  start: "top center",
  end: "+=500",
  onToggle: (self) => console.log("toggled. active?", self.isActive),
});
  • What it demonstrates: typical usage of .isActive in a GSAP animation.

Key Takeaways

  1. [read-only] Only true if the scroll position is between the start and end positions of the ScrollTrigger instance.