ygtankara Posted July 25, 2021 Share Posted July 25, 2021 Hi. As you can see in the codepen i wanted to use the same effect on multiple elements with less code and that's why i used gsap.utils.toArray but the problem is that i couldn't make it for ScrollTrigger's trigger. It triggers only first .wrap class and i tried it with gsap.utils.toArray but probably i made something wrong. See the Pen WNjdGPX by ygtankara (@ygtankara) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted July 26, 2021 Solution Share Posted July 26, 2021 That's because you're using trigger:".wrap" for ALL of your ScrollTriggers. I assume you meant to set it to the trigger to effect. Also, y: "+=-50px" can be written more succinctly: y: "-=50" See the Pen LYyezaW by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
ygtankara Posted July 26, 2021 Author Share Posted July 26, 2021 6 hours ago, GreenSock said: That's because you're using trigger:".wrap" for ALL of your ScrollTriggers. I assume you meant to set it to the trigger to effect. Also, y: "+=-50px" can be written more succinctly: y: "-=50" Thank you so much 1 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