Jump to content
GreenSock

Freehand Sam

Scrolltrigger Horizontal Scroll plus ScrollSmoother issue

Go to solution Solved by OSUblake,

Recommended Posts

Hi. I'm just starting to experiment with ScrollSmoother and found that is created an issue on a previously created horizontal scroll gallery I made with ScrollTrigger. If you look at the CodePen, you'll see it correctly scrolls to the gallery, pins it and starts to horizontally scroll the first strip of photos right to left, although it never makes it to the 4th photo. And then sort of stops moving anything...

 

What's supposed to happen after scrolling all 4 photos is unpinning that first strip of photos, scroll down to the next strip, and do the horizontal scroll again, and so on. Then eventually release and continue vertical scrolling to the bottom of the page.

 

If you comment out the ScrollSmoother.create(), you'll see how it is supposed to work. So I know my issue is introduced by ScrollSmoother, but I'm not sure where to go next to try to solve it. I tried making my scroll wrappers above the #portfolio section ONLY, but even still I had the issue. I'm new to GSAP in general, and sure I'm missing something. I just can't find the appropriate advice in the forum or docs. Any guidance is much appreciated. 

See the Pen zYRKxEV by freehand_sam (@freehand_sam) on CodePen

Link to comment
Share on other sites

  • Solution

Hi Sam,

 

You don't need that load event listener as ScrollTrigger refreshes on load.

 

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

Link to comment
Share on other sites

Solved. Thanks so much. That's what I get for copying/pasting code without reading each part and thinking it all through. I might have one more for you, but I'l create a separate Pen and topic for it if I can't solve it on my own.

  • 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.
×