Capítulo 370 de 411

Chapter 370: ScrollTrigger.saveStyles

Core Idea

Internally records the current inline CSS styles for the given elements so that when ScrollTrigger reverts (typically for a refresh() or matchMedia() change) those elements will be reverted accordingly even if they had animations that added/changed inline styles. Think of it like taking a snapshot of the inline CSS and telling ScrollTrigger "re-apply these inline styles only and dump all others wh

Key Concepts

  • targets: String | Element | Array

Code Examples

ScrollTrigger.saveStyles(".panel, #logo");
  • What it demonstrates: typical usage of ScrollTrigger.saveStyles in a GSAP animation.

Key Takeaways

  1. targets: String | Element | Array

Connects To