Capítulo 79 de 411

Chapter 79: Timeline.revert()

Core Idea

revert() (added in 3.11) kills the timeline and returns its targets to their pre-animation state, removing inline styles it added.

Code Examples

tl.revert(); // undo everything, restore original styles

Key Takeaways

  1. This is the mechanism gsap.context().revert() and matchMedia() cleanup rely on internally.

Connects To

  • gsap.context(): collects animations so they can all be reverted together.