Jump to content
Search Community

Section pinning not working

Policsek test
Moderator Tag

Recommended Posts

Hi,

 

In your codepen example ScrollTrigger is working as expected. Perhaps you could use scrub in order to play back the animations when the user scrolls back up.

 

Is worth mentioning that the CSS setup in the example you posted is quite unique, since the developer is moving the entire content. If you inspect that with devtools you'll find a div with a content class that contains all the elements. That particular container is being translated and then each section is being pinned and scaled down when the bottom reaches the bottom but also there is no pin space being applied.

 

Also I can swear that the site you set as an example is using the ScrollSmoother Plugin, the DOM structure, some of the styles being applied and the way the content animation happens have all the tells of a ScrollSmoother setup. The plugin is a Club GreenSock benefit.

 

This seems to work a bit closer to that site:

gsap.utils.toArray(".section").forEach((section, i) => {
  gsap.to(section, {
    scale: .9,
    scrollTrigger: {
      trigger: section,
      start: "bottom bottom",
      scrub: 1,
      pin: true,
      pinSpacing: false,
    },
  });
});

You can check this example for inspiration, is not exactly the same approach but the effect is also nice:

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

 

Finally there is an entire section of very nice examples using ScrollTrigger here:

https://greensock.com/st-demos/

 

Let us know if you have more questions.

 

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