Returns : Tween
GSAP’s tween instance
Details
Provides a simple way to call a function after a set amount of time. You can optionally pass any number of parameters to the function too.
Note: - Due to the way JavaScript doesn’t maintain scope (what this
refers to, or the context) in function calls, it can be useful to define the scope specifically. Therefore, the 3rd parameter allows you to define the scope
.
//calls myFunction after 1 second and passes 2 parameters:
gsap.delayedCall(1, myFunction, ["param1", "param2"]);
function myFunction(param1, param2) {
//do stuff
}