Capítulo 69 de 411

Chapter 69: Timeline.recent()

Core Idea

recent() returns the most recently added child (tween, timeline, or callback), regardless of where it landed in the sequence.

Code Examples

tl.to(".a", { x: 100 });
tl.recent(); // the .a tween just added

Key Takeaways

  1. Useful for chaining a follow-up action onto whatever was just added without keeping a separate variable.