iamjonas Posted November 15, 2022 Share Posted November 15, 2022 Hey! I would like to create a classic sticky effect using ScrollTrigger. An element should be pinned next to another element. Unfortunately, the size doesn't seem to be determined correctly. This is probably because "bottom bottom" is used as the end position, right? See the Pen bGKrKRw by jonasloerken (@jonasloerken) on CodePen 1 Link to comment Share on other sites More sharing options...
Rodrigo Posted November 16, 2022 Share Posted November 16, 2022 Hi @iamjonas and welcome to the GreenSock forums! Indeed the issue relies on the end position for the ScrollTrigger instance, but mainly because you are using an element that, because of the CSS, uses the entire height of it's parent element. Is better to use just the height of the image plus the top and bottom padding. Here is a live example: See the Pen zYadMaY by GreenSock (@GreenSock) on CodePen Hopefully this helps you getting started. Let us know if you have more questions. Happy Tweening! 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