ysk Posted September 30, 2023 Share Posted September 30, 2023 Hello, I'm trying to get my head around on how to pin a div element to top using ScrollTrigger. Pin it when element's top side reaches the top of the browser viewport. Thank you, Yannis See the Pen ZEVjWYJ by 44db (@44db) on CodePen Link to comment Share on other sites More sharing options...
Solution mvaneijgen Posted September 30, 2023 Solution Share Posted September 30, 2023 Hi @ysk welcome to the forum! 53 minutes ago, ysk said: Pin it when element's top side reaches the top of the browser viewport. You've got that working right!? And I think now you just want it to pin for as long as there is content? I've added a endTrigger: property to be your .Calendar element and then set the end: to be the bottom of that element. Hope it helps and happy tweening! See the Pen zYyLqaM?editors=1010 by mvaneijgen (@mvaneijgen) on CodePen 2 1 Link to comment Share on other sites More sharing options...
ysk Posted September 30, 2023 Author Share Posted September 30, 2023 Yes that was it. Thank you so much 2 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