Share Posted February 16, 2022 Hi there, I'm building a page at the moment which has sections with headers inside them, and I'd like to pin each header to the bottom of the previous header when the user scrolls down, with each header acting as a hotlink back to that section. I've been able to make this work by writing a different scroll-trigger for each section and manually changing the start point to accommodate the previous header, here: See the Pen zYPPjwK by fionchadd (@fionchadd) on CodePen - so this is the end effect I'm after. But I'm thinking there's probably a 'better' way to write this so I'm not dependent on writing different triggers and changing the offset each time? Is there a way to say, for the trigger start point, "please find the position of the previous header and pin this item when it reaches the bottom of that header"? No worries if there isn't! (or if this is beyond the scope of your support) I just thought I'd ask Thanks! Hannah See the Pen KKyyoae by fionchadd (@fionchadd) on CodePen Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now