Skip to main content
GSAP Animation TutorialArticle 11

GSAP Timeline Controls: Play, Pause, Reverse, Restart & More

Move the playhead forward, stop it, scrub it, reverse it and change its speed while one timeline keeps the entire sequence organized.

GSAP Timeline Controls Play Pause Reverse Restart Tutorial - NavTechSolution

Blog #10 created a timeline containing several tweens. Now one stored timeline can control that full sequence.

tl.play(); tl.pause(); tl.resume();
tl.reverse(); tl.restart();
GSAP timeline and playhead controls mental model
The timeline stores the sequence; control methods move its playhead.

1. Why control a timeline?

Menus, hero replays, onboarding, modals, presentations and debugging all benefit when one action can control a complete animation sequence.

User actionTimeline controlEntire sequence

2. Start with paused: true

gsap.timeline({ paused: true }) builds a sequence that waits for interaction instead of immediately playing.

3. play()

tl.play() moves forward from the current playhead position.

4. pause()

tl.pause() stops at the current position; it does not reset the sequence.

5. resume()

tl.resume() continues in the direction active before the pause.

6. reverse()

tl.reverse() plays backward from the current position.

7. Why reverse is powerful

An isolated menu can use menuTl.play() to open and menuTl.reverse() to close—one sequence, two directions.

8. restart()

tl.restart() returns to the beginning and immediately plays again.

9. Play vs resume vs restart

MethodBehavior
play()Forward from current position
resume()Continue after pause in existing direction
restart()Return to beginning and play

10. Main playback control demo

Controlled presentation

One timeline manages every step below.

Card 1Card 2Card 3
Status: ReadyProgress: 0%Time: 0.0s / 0.0sSpeed: 1x

11. Understanding timeline progress

progress() uses 0–1: 0 is the beginning, .5 is halfway and 1 is complete.

12. Interactive progress buttons

The main player includes 0%, 25%, 50%, 75% and 100% buttons. Setting progress moves the playhead but does not automatically play.

13. Progress slider

The labeled range input converts its 0–100 value into normalized timeline progress and supports keyboard scrubbing.

14. seek()

tl.seek(1.5) moves the playhead to 1.5 seconds. Labels and advanced positioning are reserved for later.

15. time()

progress(.5) means halfway; time(1.5) means 1.5 seconds into the timeline.

16. duration()

duration() returns the timeline’s base duration. We keep repeat-related duration details outside this beginner lesson.

17. Build a time display

Current time1.2s
Total duration2.8s
Progress43%

Cache display elements before onUpdate rather than repeatedly querying the DOM.

18. timeScale()

0.5x slower1x normal2x faster

The logical sequence remains unchanged; only playback rate changes.

19. Interactive speed controls

The players offer 0.5x, 1x, 1.5x and 2x. Changing speed does not restart playback.

20. Timeline callbacks

onStart, onUpdate, onComplete and onReverseComplete can synchronize readable UI state with playback.

21. Timeline status UI

Useful text states include READY, PLAYING, PAUSED, REVERSING, COMPLETE and START. Text keeps the state understandable without relying on color.

22. Build a playback controller

GSAP timeline player and debugging interface
A learning controller can expose status, progress, time and playback speed together.

23. Practical menu open and close

This isolated component never targets the real site navigation.

24. Practical hero replay

NAVTECHSOLUTION

Build Modern Digital Experiences

Create fast and interactive web experiences.

25. Practical card presentation

A heading, description, staggered cards and CTA can be played, paused, reversed or restarted as one section.

26. Building a timeline debugger

A compact debugger displays status, progress, current time, duration and speed while exposing playback and scrub controls.

27. Control timeline with keyboard

Optional scoped shortcuts can map Space to play/pause and R to restart. Never intercept keystrokes inside inputs, textareas, selects or editable content.

28. Timeline controls + stagger

Controls affect the entire sequence, including a child tween that uses stagger.

29. Timeline controls + easing

Shared Power easing and an individual Back ease remain part of their tweens while controls affect the container.

30. play() vs reverse()

PLAY0% ─────────→ 100%
REVERSE0% ←───────── 100%

31. pause() vs resume()

Pause stops at the playhead; resume continues in the previously active direction.

32. play() vs restart()

Play continues forward from here. Restart jumps to zero, then plays.

33. progress() vs seek()

Progress uses a normalized proportion; seek uses timeline seconds.

34. timeScale() mental model

0.5x stretches playback time, 1x keeps the normal rate and 2x compresses playback time.

35. Combining multiple controls

tl.play(); tl.pause(); tl.resume(); tl.reverse();
tl.restart(); tl.progress(0.5); tl.seek(1); tl.timeScale(2);

Every call addresses one stored timeline instance.

36. Common timeline-control mistakes

  1. Forgetting paused: true.
  2. Calling methods on an undefined timeline.
  3. Recreating a timeline on every click.
  4. Using restart when resume is intended.
  5. Assuming pause resets.
  6. Assuming progress starts playback.
  7. Expecting timeScale to restart.
  8. Ignoring the reverse start position.
  9. Stacking competing timelines.
  10. Not updating UI state.
  11. Ignoring reduced motion.
  12. Hijacking global keyboard controls.

37. Accessibility

Every control uses a real labeled button; sliders have labels and status remains textual. Reduced-motion users get near-instant sequences with final content available.

38. Performance

Cache frequently updated elements, keep onUpdate light and prefer transforms and opacity over unnecessary layout-heavy animation.

39. Main interactive timeline lab

NAVTECHSOLUTION LAB

GSAP Timeline Control Lab

Scrub, reverse and change speed without rebuilding the timeline.

Step 1Step 2Step 3
Status: ReadyProgress: 0%Time: 0.0s / 0.0sSpeed: 1x

40. Timeline lab implementation

The lab caches its targets and readouts, builds one paused timeline, uses an isScrubbing flag, and synchronizes the slider only while the user is not dragging it.

41. Mini challenge

Build a player for a heading, paragraph and button with Play, Pause, Reverse and Restart. Store the timeline once and attach each control to that instance.

42. Quick reference

MethodPurposeExample
play()Play forwardtl.play()
pause()Pause heretl.pause()
resume()Continuetl.resume()
reverse()Play backwardtl.reverse()
restart()Start againtl.restart()
progress()Read/set 0–1tl.progress(.5)
seek()Move to timetl.seek(1.5)
time()Read/set timetl.time()
duration()Get durationtl.duration()
timeScale()Change speedtl.timeScale(2)

43. Control cheat sheet

GSAP timeline control methods cheat sheet
A compact reference for common timeline playback methods.

44. Mental model

The timeline stores the sequence. The playhead represents the current location. Control methods move, stop or reposition that playhead.

45. Preview: timeline position parameter

The next lesson explains how tweens overlap, begin together or start relative to another child. It remains unlinked until created.

Review the series foundations: getting started, targeting, to(), from(), fromTo() and Power and Sine.

Frequently asked questions

How do I play a GSAP timeline?

Call timeline.play() to move forward from the current playhead position.

How do I pause a GSAP timeline?

Call timeline.pause(); the playhead stays at its current position.

What is the difference between pause() and resume()?

pause() stops playback; resume() continues in the direction active before the pause.

How do I reverse a GSAP timeline?

Call timeline.reverse() to play backward from the current position.

What is the difference between play() and restart()?

play() continues from the current position; restart() returns to the beginning and plays.

How do I jump to 50% of a GSAP timeline?

Call timeline.progress(0.5). Setting progress does not automatically start playback.

What does seek() do in GSAP?

seek() moves the playhead to a timeline time measured in seconds.

How do I change GSAP timeline speed?

Use timeline.timeScale(), such as timeScale(0.5) or timeScale(2).

How do I create a timeline progress slider?

Convert the slider’s 0–100 value to 0–1 and pass it to timeline.progress().

Can I control a GSAP timeline on a PHP website?

Yes. PHP renders the HTML and GSAP controls it in the browser.