yarnb Posted November 19, 2022 Share Posted November 19, 2022 When I set pin: true on the target element, it will get a set of max-height, max-width styles, which causes me to lose the effect of its original size gradient. How can I turn off this feature? See the Pen QWxaymz by bzonegogogo (@bzonegogogo) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted November 19, 2022 Solution Share Posted November 19, 2022 That's necessary for proper pinning. But you could try just animating those max values too: See the Pen MWXryJy by GreenSock (@GreenSock) on CodePen Or better yet, wrap the element in a container so you can pin the container and animate the target. It's almost never a good idea to animate the same element that you're pinning (well, at least dimensions/position). Link to comment Share on other sites More sharing options...
yarnb Posted November 20, 2022 Author Share Posted November 20, 2022 1 hour ago, GreenSock said: That's necessary for proper pinning. But you could try just animating those max values too: Or better yet, wrap the element in a container so you can pin the container and animate the target. It's almost never a good idea to animate the same element that you're pinning (well, at least dimensions/position). In this way, when I enlarge the scrolling content, once the scrollerTrigger is out of range, the size of the element is reset See the Pen vYrpGwM by bzonegogogo (@bzonegogogo) on CodePen But now I am refactoring the code in the direction of your suggestion, thank you Link to comment Share on other sites More sharing options...
GreenSock Posted November 20, 2022 Share Posted November 20, 2022 Yeah, then I'd just wrap it in a container and pin the container instead. Does that work well for you? Link to comment Share on other sites More sharing options...
yarnb Posted November 20, 2022 Author Share Posted November 20, 2022 22 minutes ago, GreenSock said: Yeah, then I'd just wrap it in a container and pin the container instead. Does that work well for you? work for me 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