LauraS Posted April 6, 2023 Share Posted April 6, 2023 I set up two pins that work fine. One pins a container that holds an image, the other pins a container that holds some text. But lower down, I have a second image container. I used the same code to pin it, and yet it doesn't pin. What am I doing wrong, please? See the Pen OJBJZmm by lschneiderman (@lschneiderman) on CodePen Link to comment Share on other sites More sharing options...
LauraS Posted April 6, 2023 Author Share Posted April 6, 2023 I found out the reason -- I was pinning using a variable "height" to represent the height of the screen for the end property. Somehow, that didn't work. When I used Quote end: "+=600" ...that worked. Link to comment Share on other sites More sharing options...
Solution GreenSock Posted April 7, 2023 Solution Share Posted April 7, 2023 That's just because you were feeding in a number which is interpreted as an absolute scroll number (from the very top). So I think you meant to do this: end: () => "+=" + (window.innerHeight * 2) I'm using a function-based value so that it updates automatically if the viewport resizes. And the "+=" means to interpret it as relative, so that many pixels PAST where the start of that ScrollTrigger is. Happy tweening! Link to comment Share on other sites More sharing options...
LauraS Posted April 7, 2023 Author Share Posted April 7, 2023 @Jack -- thanks! 1 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