jacksmug Posted May 24, 2023 Share Posted May 24, 2023 Hi I follow the example provided by @Rodrigo. But I want to add title and pinned the title with card stack section, yes the title pinned for now but all the cards are going down with the scroll. Can you guys help me? Thank you so much. See the Pen GRXdGGq by GreenSock (@GreenSock) on CodePen See the Pen MWPLQqb by syedzaquan (@syedzaquan) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted May 24, 2023 Share Posted May 24, 2023 Hi, The problem is that you are pinning the entire container that also wraps the cards, which are also being pinned, so that creates a very erratic behaviour. Since you're not using pin spacing for the cards, just do the same for the title. For the start and end points you can use the offset top property and the previous ScrollTrigger instance's end point (that would be the last card's ScrollTrigger): https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop https://greensock.com/docs/v3/Plugins/ScrollTrigger/previous() Here is a fork of your codepen: See the Pen XWxOwVp by GreenSock (@GreenSock) on CodePen Hopefully this helps. Happy Tweening! 1 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