Jump to content
GreenSock

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

Tween

.then()

.then( callback:Function ) : Promise

Returns a promise so that you can uses promises to track when a tween or timeline is complete.

Parameters

callback: Function

The function that you want to handle the Tween's promise that is generated.

Returns : Promise

Returns a promise so that you can uses promises to track when a tween or timeline is complete.

Details

Some people prefer to use Promises instead of onComplete callbacks. You can now tag on a then() call to the end of any tween or timeline that’ll return a Promise.

  1. gsap.to(".class", {duration: 1, x: 100}).then(yourFunction).then(...);
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.
×