Jump to content


ScrollTrigger - adding to class not working on multiple

Recommended Posts

I've been running into this issue with ScrollTrigger, where a single instance of my array works, but multiple do not.



Here is one that works with only one instance:

See the Pen ExQyyMJ by chailandau (@chailandau) on CodePen


I've looked on the forums and not found anything that helped me, would love some insight!


Multiple instances do not work:

See the Pen LYQZZdK by chailandau (@chailandau) on CodePen

Link to comment
Share on other sites

Hi chailandau,


It works, but you have multiple triggers nested inside an element you are pinning. Perhaps you are looking for pinnedContainer?



Element | String - If your ScrollTrigger's trigger/endTrigger element is INSIDE an element that gets pinned by another ScrollTrigger (pretty uncommon), that would cause the start/end positions to be thrown off by however long that pin lasts, so you can set the pinnedContainer to that parent/container element to have ScrollTrigger calculate those offsets accordingly. Again, this is very rarely needed. (added in 3.7.0)


See the Pen abqZmLO by GreenSock (@GreenSock) on CodePen


  • Like 3
Link to comment
Share on other sites

That was it, thanks so much! That makes sense now that I think about it :D

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.