Capítulo 341 de 411

Chapter 341: .labelToScroll

Core Idea

Converts a timeline label into the associated scroll position (only applicable to ScrollTriggers whose "animation" is a timeline)

Key Concepts

  • label: String

Code Examples

btn.addEventListener("click", () => {
  gsap.to(window, { scrollTo: tl.scrollTrigger.labelToScroll("myLabel") });
});
  • What it demonstrates: typical usage of .labelToScroll in a GSAP animation.

Key Takeaways

  1. label: String