Capítulo 107 de 411

Chapter 107: Tween.kill()

Core Idea

kill() stops the tween, with optional scoping to specific targets and/or properties instead of killing the whole thing.

Reference Tables

ParameterTypeDefaultDescription
targetObjectnulllimit killing to this target (or array of targets); omit to affect all
propertiesListString"all"comma-delimited property names to stop animating

Code Examples

tween.kill(); // kill everything
tween.kill(myObject, "opacity,x"); // only stop these properties on this target

Key Takeaways

  1. Unlike Timeline's parameterless kill(), Tween's version can target specific properties/targets within a multi-target tween — killing the rest of the tween's properties leaves it running.

Connects To

  • gsap.killTweensOf(): kill by target lookup instead of by direct reference.