Jump to content
Search Community

Can i auto set height to 'auto' in pinned scrolltrigger?

Poylar test
Moderator Tag

Go to solution Solved by Poylar,

Recommended Posts

I see what you mean. I don't know a solution for how to recalculate the height of the element, that is been set to fixed with ScrollTrigger, but I would work around that. 

 

I've restructured your code a bit, add some CSS and created an animation for the element in question. I've given the element .hidden-text the same styling as the aside and just animate that from a height of 0, this way it looks like the aside element is growing and this has the same effect as if the height of the aside it self would grow. (You need to tweak the CSS a bit to make it perfectly match your original CSS)

 

See the Pen VwdbMpv?editors=0011 by mvaneijgen (@mvaneijgen) on CodePen

 

Hope it helps and happy tweening! 

  • Like 2
Link to comment
Share on other sites

On 11/12/2022 at 5:36 PM, mvaneijgen said:

I see what you mean. I don't know a solution for how to recalculate the height of the element, that is been set to fixed with ScrollTrigger, but I would work around that. 

 

I've restructured your code a bit, add some CSS and created an animation for the element in question. I've given the element .hidden-text the same styling as the aside and just animate that from a height of 0, this way it looks like the aside element is growing and this has the same effect as if the height of the aside it self would grow. (You need to tweak the CSS a bit to make it perfectly match your original CSS)

 

 

 

 

Hope it helps and happy tweening! 

Thanks for the answer, but I think this solution does not really help me.

Any ideas?

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...