Hallo,
I've tried the follwing code:
var i = 0;
var tl = new TimelineLite({
onStart:function() {
i++;
if (i <= 2) {
this.set({}, {}, '+=1.0');
this.to("#firstitem,#seconditem", 1.0, {autoAlpha: 0,ease:Power1.easeInOut});
}
},onComplete:function() {
if (i <= 2) {
this.restart();
}
}
});
tl.from("#firstitem", 1, {autoAlpha: 0, x:100,y:-100,scale:3.0,ease:Power1.easeInOut});
tl.from("#seconditem", 1, {autoAlpha: 0, x:50,y:-50,scale:3.0,ease:Power1.easeInOut});
// ... and so on
But it won't work. The first time OnStart is fired it changes the timlines for all following loops, included loop 3.
Thats what I'm trying to get: After every loop all animated elements has to fade out, except for the last loop. All animated elements should stay. Because of filesize I have to realise this with TimelineLite.
Thanks for your help!
Beste regards
Christi4n