Capítulo 58 de 411

Chapter 58: Timeline.iteration()

Core Idea

iteration() gets or sets which repeat cycle a repeating timeline is currently on, letting you jump straight to a particular pass.

Reference Tables

ParameterTypeDescription
valueNumberwhich repeat iteration to jump to (1-indexed)

Returns: Number (getter) or self (setter).

Code Examples

let tl = gsap.timeline({ repeat: 5 });
tl.iteration(3); // jump to the 3rd pass

Connects To

  • Timeline.repeat / repeatDelay: what defines how many iterations exist.