TerraHQ Posted December 8, 2022 Share Posted December 8, 2022 Hey! I'm having this issue that everything works as expected, but last element is stays pin on the screen and on top of the magenta/following section. Is there any way to prevent this? See the Pen mdKoKqp by andresclua (@andresclua) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted December 8, 2022 Share Posted December 8, 2022 Hi, Just adding a position property (relative in this case) to that container, seems to fix the issue: See the Pen rNKRZbb by GreenSock (@GreenSock) on CodePen Let us know if you have more questions. Happy Tweening! 1 Link to comment Share on other sites More sharing options...
TerraHQ Posted December 8, 2022 Author Share Posted December 8, 2022 thank you so much for your help, but in that case is going over my pin section which is not what I want. what I want is that once the pinned section ends, you can keep scrolling normal. I've made another codepen, that it's better but not exactly since there is a white gap, pls take a look on a large screen. See the Pen YzvgONz by andresclua (@andresclua) on CodePen Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted December 12, 2022 Solution Share Posted December 12, 2022 Hi, That's because ScrollTrigger adds the pin space for the last element: ScrollTrigger.create({ trigger: panel, start: "top top", pin: true, pinSpacing: (index === array.length - 1) ? true : false }); That conditional logic is true for the final panel, so the pin space is added there. You just need pinSpacing: false for all the panels and your final panel should have a relative position. Happy Tweening! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now