Share Posted November 10, 2021 Hi! How can I setPin() use this method in ScrollTrigger. My purpose is so: the scroll must be stop till the animation end. Is it possible in ScrollTrigger? Thanks! Link to comment Share on other sites More sharing options...
Solution Solution Share Posted November 10, 2021 Hi @azadsarxanli, You're looking for pinning! ✨ See the Pen YzXdbQo by GreenSock (@GreenSock) on CodePen https://greensock.com/docs/v3/Plugins/ScrollTrigger pin Boolean | String | Element - An element (or selector text for the element) that should be pinned during the time that the ScrollTrigger is active, meaning it will appear to "stick" in its starting position while the rest of the content continues scrolling underneath it. Only one pinned element is allowed, but it can contain as many elements as you want. Setting pin: true will cause it to pin the trigger element. Warning don't animate the pinned element itself because that will throw off the measurements (ScrollTrigger is highly optimized for performance and pre-calculates as much as possible). Instead, you could nest things such that you're animating only elements INSIDE the pinned element. Good luck with your project 1 1 Link to comment Share on other sites More sharing options...
Author Share Posted November 10, 2021 Oh! That's what I'm searching for! Thank you! 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