Capítulo 59 de 411

Chapter 59: Timeline.kill()

Core Idea

kill() immediately stops the timeline and removes it from its parent, releasing it for garbage collection.

Key Concepts

  • Not for reuse: once killed, an animation shouldn't be played again — use pause() instead if you intend to resume it later.

Code Examples

tl.kill(); // stop and discard

Connects To

  • Timeline.pause(): use instead of kill() when you plan to reuse the timeline.
  • gsap.killTweensOf(): kill by target instead of by direct reference.