Jump to content
Search Community

Issue with pin with small height <section>

Cody Ng test
Moderator Tag

Recommended Posts

I would like to snap both section 2 and section 3 when scrubbing the animation in section 2.

And unpin both if the animation is finished. I don't want section 2 and 3 overlap each other.

Here is the wrong result: 

See the Pen VwavOqX by codyng (@codyng) on CodePen

I don't know how to do that with ScrollTrigger.

 

Thanks again.

Link to comment
Share on other sites

48 minutes ago, Cody Ng said:

I would like to snap both section 2 and section 3

By "snap" do you mean "pin"? 

 

I think it'd be easiest to use a container for the sections you want to stay pinned during that portion:

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

 

Side notes:

  • It's best to avoid animating properties like width because they're not performant. Stick to properties that are performant like scaleX instead.
  • We highly recommend setting all of your transforms with GSAP because not doing so can lead to errors. See this post for more info:
  • 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...