Jump to content


Scrolltrigger how to pin to following section

Moderator Tag
Go to solution Solved by mvaneijgen,

Recommended Posts

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

  • Solution

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


  • Like 2
Link to comment
Share on other sites

Great thank you, I used that + and offset based on the title height. 

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.