Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Tween

.restart()

.restart( includeDelay:Boolean, suppressEvents:Boolean ) : *

Restarts and begins playing forward from the beginning.

Parameters

includeDelay: Boolean

(default = false) — Determines whether or not the delay (if any) is honored when restarting. For example, if a tween has a delay of 1 second, like gsap.to(obj, {duration: 2, x: 100, delay: 1}); and then later restart() is called, it will begin immediately, butrestart(true) will cause the delay to be honored so that it won’t begin for another 1 second.

suppressEvents: Boolean

(default = true) — If true (the default), no events or callbacks will be triggered when the playhead moves to the new position defined in the time parameter.

Returns : *

self (makes chaining easier)

Details

Restarts and begins playing forward from the beginning.

  1. //restarts, not including any delay that was defined
  2. myAnimation.restart();
  3. //restarts, including any delay, and doesn't suppress events during the initial move back to time:0
  4. myAnimation.restart(true, false);
Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.
×