Jump to content
GreenSock

Nagrik

pin top and bottom container on scroll

Moderator Tag
Go to solution Solved by Cassie,

Recommended Posts

Hello everyone, I can't figure out how to do this:
I have regular blocks at the top and bottom of the content, with two trigger blocks in between. I need that when I scroll the second block, there are no indents above and below, similarly with the third block.
I will be grateful if you help.

1.jpeg

2.jpeg

3.jpeg

See the Pen RwxvBjL by Nagrik (@Nagrik) on CodePen

Link to comment
Share on other sites

  • Solution

Hi there!

 

If you need to pin sections without spaces underneath or above you need to wrap *all* the elements that need to be pinned in a wrapper.

like so

See the Pen YzYBRPG?editors=1010 by GreenSock (@GreenSock) on CodePen

  • Like 3
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.
×