Capítulo 89 de 411

Chapter 89: Timeline.to()

Core Idea

to() inserts a .to()-style tween into the timeline — the most common way to add animation to a sequence. Shorthand for add(gsap.to(...)).

Reference Tables

ParameterTypeDescription
targetObject | Array | Stringtarget(s) or selector text
varsObjectending values + special props
positionNumber | Stringwhere in the timeline

Code Examples

tl.to(".box", { x: 100, duration: 1 }).to(".box2", { y: 50, duration: 1 });

Connects To

  • Timeline.from() / fromTo() / set(): the other tween-insertion shortcuts.