GM_sql Posted March 22, 2022 Share Posted March 22, 2022 Hi, I have a very simple animation and I need to apply the below criteria to get the the replacement effect: 1) after each animation of a single "box_info" item I need to pause the stage, say 1s, 2) after each animation of a single "box_info" item I need to restore it's style: opacity to 0. Is it possible to apply stagger, and how ? const play_intro = gsap.timeline({paused: false, repeat: -1}); play_intro.from(".box_info", {autoAlpha: 0, stagger: 1, onComplete: console.log("end")}) Link to comment Share on other sites More sharing options...
PointC Posted March 22, 2022 Share Posted March 22, 2022 I'm not 100% sure what you're asking, but you can call onComplete for each staggered element and target it like this: See the Pen popEqGw by PointC (@PointC) on CodePen If that doesn't answer your question, could you provide a minimal demo please? Thanks. Happy tweening. 3 Link to comment Share on other sites More sharing options...
GM_sql Posted March 22, 2022 Author Share Posted March 22, 2022 Thank you @PointCThis is exactly what I'm looking for, however I still have a problem in order to coordinate the very last and the very first items between loops (purple -> green). Here the modified code. See the Pen mdprZeM by grzegorz-malinowski (@grzegorz-malinowski) on CodePen Link to comment Share on other sites More sharing options...
PointC Posted March 22, 2022 Share Posted March 22, 2022 const play_intro = gsap.timeline({repeat: -1, repeatDelay: 0.5}); 3 Link to comment Share on other sites More sharing options...
GM_sql Posted March 22, 2022 Author Share Posted March 22, 2022 Works perfectly. Thx. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now