Share Posted September 4, 2022 hi friends, let's say i have different children elements with the same class name that i want to animate on scroll, what am i doing wrong here? thanks! https://codesandbox.io/s/tender-cherry-j8cejs?file=/src/App.js Link to comment Share on other sites More sharing options...
Solution Solution Share Posted September 4, 2022 I assume you wanted to do something like this?: https://codesandbox.io/s/objective-mcnulty-tj370o?file=/src/App.js The problems: You set your trigger element to a selector function (not an element, and not the results of the function call). You created ONE tween of ALL the circles that would get triggered at one spot, but I think you wanted an animation for EACH of the circles, all with their own ScrollTrigger so they fire and different spots (when they enter). So a .forEach() loop is perfect. Does that help? 2 Link to comment Share on other sites More sharing options...
Author Share Posted September 4, 2022 yes, that's it, thank you! 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