Jump to content
Search Community

Pin the section to the next section, but animation is too fast.

Reginna test
Moderator Tag

Recommended Posts

I want to make some animation with GSAP. Pin the section and run all animations for that section, fixed the section to the next section, then fade out in the third section (each section does the same logical animation).

I use +=200% to fixed in the next section, but the animation is too fast.
How can I use +=200% and +=5000 at the same time?

See the Pen KKRQbwd by reginna (@reginna) on CodePen

Link to comment
Share on other sites

Hi,

 

You can use a function based value for that:

const tl = gsap.timeline({
  scrollTrigger: {
    trigger: item,
    start: "top top",
    end: () => 5000 + document.body.clientHeight * 2,
    scrub: true,
    pin: true,
    pinSpacing: false,
    markers: true
  }
});

Let us know how it works.

 

Happy Tweening!

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