Jump to content
Search Community

ScrollTrigger: Multiple pins in a row with defined 'end' issue.

Samuel Aaron McGuire test
Moderator Tag

Recommended Posts

I'm looking to have two pins in a row using ScrollTrigger. I've tried setting the `refreshPriority` and calling "refresh" at the end of the ScrollTrigger.create calls. Regardless, the second pins "end" collapses to the start of its pin trigger. 

 

Is there something I'm missing? Please halp. :) 

 

 

See the Pen eYBaZdW by samcreate (@samcreate) on CodePen

Link to comment
Share on other sites

Hey @Samuel Aaron McGuire

 

The problem here, is that for both pinning ScrollTriggers, you are using an absolute value for the end.

Both ScrollTriggers end at the same time the way you have it set up - so here the second ScrollTrigger unpins at the same time it pins.

 

If you want to use values relative to the start (one sentence of mine in the other thread might have been misleading), you would still have to use them with this prefix "+="

 

end: "+=" + 5 * innerHeight,

 

See the Pen 2dddbaff3f971a04e1e5292f2515f838 by akapowl (@akapowl) on CodePen

 

 

Is this what you were looking for?

  • Like 3
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...