user3610227
user3610227

Reputation:

Greensock's Timeline aligning child animations

I'm trying to align the start of all children tweens, want them to start all at once without any delay but it seems like it's done in sequence, one child finishes, then the second starts, the third one after the second and so on... not sure what am I doing wrong in here?

var timeline = new TimelineLite({align:"start", stagger: 0, onComplete:Delegate.create(this, this.resetComplete), onCompleteParams:[id]});

    for(var i=0; i<this.figures.length; i++) {
        timeline.add(TweenLite.to(this.figures[i], 1, {left: this.margin + "px"}));
    }

Upvotes: 0

Views: 222

Answers (1)

user2727195
user2727195

Reputation: 7330

use insert instead of add...

timeline.insert(TweenLite.to(this.figures[i], .3, {left: this.margin + "px"}));

Upvotes: 1

Related Questions