Share Posted January 23 I am trying to fix a title until it reaches the section below. It all works fine unless I resize the window which can change the height of the title (if it goes onto more lines) and so the end position is now wrong. I am using the title height in order to position it correctly : var titleHeight = document.querySelector(".project-title").offsetHeight; Inside scrolltrigger: end: "top bottom-=" + titleHeight, How can I update the titleHeight on browser resize ? or is there another way to set this value dynamically during the scroll so it always checking what the current height is? See the Pen zYLRjxv?editors=1010 by garethworld (@garethworld) 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