Jump to content
Search Community

Continuous Pinning after Animation

sandman test
Moderator Tag

Recommended Posts

In the example provided, I am trying to keep the first div pinned after the animation plays in the timeline.  If I set the end to a greater percentage, it just extends the timeline out.  I'd like to pin the dive, run the timeline, and then keep the dive pinned so the next div will scroll on top of the first div.  If I set pinSpacing to false, the animation and scroll happens at the same time.  I'm not sure how to do this.

 

Thanks!

See the Pen poZRyqr by sandman18 (@sandman18) on CodePen

Link to comment
Share on other sites

It's a tricky scenario because technically you want the animation to "finish" but the pinning has to keep going for longer (while the next section scrolls up over the top). So you need to do a little math and...

  1. Set the next section to overlap by 100vh, so margin-top: -100vh
  2. Add some extra space to the end of the timeline so that your "real" animation appears to finish and then nothing else is happening in the animation while the next section scrolls up over the top.

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

 

Is that what you're looking for? 

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