Hi, I've been working on building a loading 'spinner', had the basic animation working, but I've ran into an issue once I tried to add my tweens to a timeline.
The code that works is:
TweenMax.staggerFromTo(bars, duration, {
opacity: 0.6,
repeat: -1
}, {
opacity: 0.2,
repeat: -1
}, duration / numberOfBars);
However, when I add a timeline: var tl = new TimelineMax({align:'sequence'});
tl.fromTo($spinner, 0.5, {
opacity: 0
}, {
opacity: 1
});
tl.addLabel('loop')
tl.staggerFromTo(bars, duration, {
opacity: 0.6,
repeat: -1
}, {
opacity: 0.2,
repeat: -1
}, duration / numberOfBars);
tl.play(0);
the staggerFromTo does not seem to repeat and plays only once.
(I was not sure whether the 'from' or the 'to' needed the repeat paramater, but seems like it needs to be in the 'to'.)
Am I doing something wrong there?
Thanks,
Gavan