Jump to content
Search Community

The pin triggers the max-height, max-width style, how to turn it off?

yarnb test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...