Basics

Guides

Sequences

Chaining together multiple animations is straightforward with the sequence() function. Each item is added to the timeline in order. While it is possible to do this with the animate() or timeline() function, having a special helper for sequences makes it easier to adjust the duration of individual sections of a sequence.

In this example, #first is being moved to the right (x: [0, '200px']) and is faded out. Next, #second is being moved to the left to the original position (x: ['200px', 0]) and is faded in.