Jump to content

Matthieu Rébillard

Update .pin-spacer height when content height changes ?

Recommended Posts


Is it possible to update/refresh the .pin-spacer element height when the pinned element height changes ?

You can see on the Codepen demo, when the lightgreen element (.container) is pinned, the padding is decreased, so the .pin-spacer appears behind (green). I would'nt see that element behind, i would the following element .content stick to the pinned element.


Thank you for your interest about my problem :)

See the Pen LYjQaJZ by korell (@korell) on CodePen

Link to comment
Share on other sites

No, not really. I wouldn't recommend changing pin-spacer properties in general but I suppose you could hard-wire it to an onUpdate like this: 

See the Pen porLJbN?editors=0010 by GreenSock (@GreenSock) on CodePen

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.