Share Posted May 23 Hi, How can I get the animation to be triggered separately for each svg? See the Pen KKGJdYe by mrtsiradisi (@mrtsiradisi) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted May 23 I would create a loop for each element you wan two have a trigger for and then add the logic for each item in the loop. Your example also forgot to load ScrollTrigger and personally I like to split my ScrollTrigger logic from the animation, so that is why I've created a timeline for each element. Hope it helps and happy tweening! See the Pen LYgqGOR?editors=1010 by mvaneijgen (@mvaneijgen) on CodePen 3 Link to comment Share on other sites More sharing options...
Author Share Posted May 23 Thanks, what I was trying to do was as follows. scrollTrigger: { trigger: container+" svg", start: "top+=20% center", end: "bottom-=20% center", toggleActions: "play none reverse none", markers: true } I was getting an error when I did it this way. That's all it takes to do. thank you for your time. const item = container.querySelectorAll("path"); 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