Hi there,
i've got a similar question. I also want to wait for some time, but without adding it to the duration of the whole timeline (e.g. Slider is not moving).
One way would be:
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
var timeline = new TimelineLite();
timeline.add( TweenLite.fromTo("h1", 0.5, {left:-200,top:-200}, {left:30,top:30}) );
timeline.call(sleep, [2000]);
timeline.add( TweenLite.fromTo("h1", 0.5, {left:30,top:30}, {left:-200,top:-200}) );
I know its nasty. Is there a better way doing it with GSAP directly?