Share Posted October 21, 2022 I want to pin a title until it aligns to the section below. I am confused about how I can express this in the end value - is it possible to pass an element to the end value? See the Pen abGemRN by garethj (@garethj) on CodePen Link to comment Share on other sites More sharing options...
Solution Solution Share Posted October 21, 2022 Yes you can with endTrigger: see the docs for more info. You have to tweak the values a bit, because the line-height of the elements are not the same. String | Element - The element (or selector text for the element) whose position in the normal document flow is used for calculating where the ScrollTrigger ends. You don't need to define an endTrigger unless it's DIFFERENT than the trigger element because that's the default. See the Pen poVMNdg by mvaneijgen (@mvaneijgen) on CodePen 2 Link to comment Share on other sites More sharing options...
Author Share Posted October 21, 2022 Great thank you, I used that + and offset based on the title height. 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