Jump to content
Search Community

(ScrollTrigger) Spacing Issues with Pinned Section

David Kennedy test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I am trying to create a scroll-through full-page photo that transitions between photos with text sections above and below that scroll by paragraph. The section on top works as expected and the fade through on the photos works but the text section below doesn't track properly. I made a CodePen to show my troubles. Thanks in advance.

See the Pen rNpYaqq by jdavidkennedy (@jdavidkennedy) on CodePen

Link to comment
Share on other sites

  • David Kennedy changed the title to (ScrollTrigger) Spacing Issues with Pinned Section
  • Solution

If I understand your question properly, it's because you created your ScrollTriggers out of order. You can either create them in the order they appear, set refreshPriority for each, or you can simply run this at the end of your code: 
 

ScrollTrigger.sort();

And it'll try to figure it out by itself. That's the simplest fix here. 

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