Jump to content
Search Community

How to keep scroll to the end of section when pin the container?

Krix test
Moderator Tag

Recommended Posts

In my case, each section has a dynamic height and I expect to when the current section scroll to the end of it, the fadeout animation will play and fade in the next section. But when I pin the container, the section that has more than 100vh will pin and not scroll to the end.

 

use can see the example project here: https://codesandbox.io/s/cool-shape-lnywsh?file=/src/App.tsx

Link to comment
Share on other sites

I'm not sure I understand your goal correctly, but if you're trying to make each section scrollable until it ends, I think you'd need to completely change your setup. There are several ways to approach it actually. One might be similar to this: 

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

 

Or maybe build the "scroll" into your timeline by faking it with a y tween. 

 

Unfortunately it's beyond the scope of free help we can offer in these forums to build something for you, but hopefully that gets you going in a good direction. If you get stuck, feel free to post your revised minimal demo. You can also contact us about paid consulting services if you need experts to walk alongside you and help build out a demo illustrating a solution. 

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