Capítulo 42 de 411

Chapter 42: Timeline.call()

Core Idea

call() is a shorthand for inserting a plain function call into the timeline, equivalent to add(gsap.delayedCall(...)) with less code.

Reference Tables

ParameterTypeDefaultDescription
callbackFunctionfunction to call
paramsArraynullarguments to pass
position*"+=0"where in the timeline

Returns: self.

Code Examples

tl.call(() => console.log("halfway"), null, 2);

Key Takeaways

  1. Prefer this over manually adding a gsap.delayedCall() when the call is already conceptually part of a timeline sequence.

Connects To

  • gsap.delayedCall(): the underlying mechanism this wraps.