Jump to content
Search Community

Selecting multiple triggers in one ScrollTrigger which uses gsap.utils.toArray

ygtankara test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

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

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 :)

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...