Capítulo 11 de 411
gsap.delayedCall() invokes a function after a set time, synced to GSAP's render loop (unlike setTimeout, which can fire outside the screen refresh cycle), and returns a killable Tween.
gsap.delayedCall(1, myFunction, ["param1", "param2"]);
function myFunction(param1, param2) {
// runs 1 second later, in sync with GSAP's ticker
}
// cancel it later:
var call = gsap.delayedCall(1, myFunction);
call.kill();
// or without keeping a reference:
gsap.killTweensOf(myFunction);
setTimeout when timing needs to stay in sync with other GSAP animations (e.g. pausing everything also pauses delayed calls tied to the same timeline).gsap.killTweensOf(fn) cancels it without needing to keep a variable reference.