Jump to content
Search Community

Scrubbing inside pinned element

Hugo S. test
Moderator Tag

Recommended Posts

Hi,

I'm trying to achieve the following:

Have a 100vh section that should be pinned once it reaches the top of the screen (that much I'm able to do).

Inside the div there are two divs in a flex layout, each taking 50% of the width.

The left div should stay fixed (it's the section title/header). The right div content should scroll (while the parent is pinned) in a scrubbing fashion.

Once the right div content reaches the last element, the parent should be unpinned and normal scroll of the page should resume.

As a very recent arrival to the Greensock family I'm struggling with it. Is there any example of what I want to achieve you can direct me to?

Any help is truly appreciated.

Thanks in advance!

Link to comment
Share on other sites

Hey hsombreireiro and welcome to the GreenSock forums. Thanks for supporting GreenSock with a Club GreenSock membership!

 

Does the parent container have to be pinned? Nested pinning is messy at the least.

 

It sounds like you want something along the lines of this demo (found in the ScrollTrigger docs demo list):

See the Pen YzyqVNe by GreenSock (@GreenSock) on CodePen

 

Either way it'd be really helpful if you made a minimal demo for us to take a look at.

 

  • Like 1
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...