Hi,
I was wondering if it was possible to create an animation and 'stagger' it over a list of element.
I explain myself, when using stagger you can only use the 'y' (or other css property) property only once like this :
var tlGo = new TimelineMax({paused: true, repeat: -1});
tlGo.staggerTo(".line", 1, {x:50}, 0.005);
// In this case each line would go x:50 one after the other
// But what if I want to do x:50 then x:0 one after the other???
What if I want to stagger a more complex animation :
var tlGo = new TimelineMax({paused: true, repeat: -1});
tlGo.staggerTo(".line", 1, {x:50}, {x:400}, {y: 200}, {x: 100}, {y: 50}, 0.005);
//This obviously won't work, it's a way to explain my point.
What I would like to do is something like that (creating a complete animation) :
tlGo.to(".line", 1, {x:50}, 0.005)
.to(".line", 1, {x:300, y: 20}, 0.005)
.to(".line", 1, {x:20, y: 200}, 0.005);
and then stagger this to each element.
I'm thinking about using a simple loop, but I would prefer do it the GSAP way if a GSAP way is available.
Hope you understand my question. Thank you
In the Codepen example I'm doing like this :
var tlGo = new TimelineMax({paused: true, repeat: -1});
tlGo.staggerTo(".line", 1, {x:50}, 0.005)
.staggerTo(".line", 1, {x:0, ease:easing}, 0.005, '-=.99');
But it's not exactly what I want to do. The timing is really hard to manage that way.