Jump to content
Search Community

How to remove that pin space if use once true

Renny_0007 test
Moderator Tag

Recommended Posts

Hi,

 

This seems to work the way you expect:

const tl = gsap.timeline({
  scrollTrigger: {
    trigger: ".get_started_main",
    start: "center center",
    pin: ".wrapper",
    scrub: true,
    markers: true,
    onLeave: (self) => {
      const start = self.start;
      self.scroll(start);
      self.kill();
      self.animation.progress(1, true);
      ScrollTrigger.refresh();
      window.scrollTo(0, start);
    },
  }
});

Here is a fork of your demo:

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

 

Hopefully this helps.

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