Jump to content
Search Community

Sync (Observer & ScrollTrigger & ScrollSmoother)

noviedo test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I just took the GSAP Horizontal Scroll pen with ScrollTrigger, and I added ScrollSmoother and this works perfectly. And also I have a requirement to do draggable the horizontal section, so for that I used the Observer plugin to use the onDrag function to update the scroll() of the main ScrollTrigger. So, this also works fine, but I wanna reach a smooth movement on the drag, like a ('lerp' ,'momentum', 'inertia') as when I scroll, but I can't reach. Any suggestions are welcome.

I did this to update the scroll value of the ScrollTrigger.

 

Observer.create({
  target: ".container",
  type: "wheel,touch,pointer",
  onDrag: (self) => {
    scrollTween.scrollTrigger.scroll(
      scrollTween.scrollTrigger.scroll() - self.deltaX
    );
  }
});


Thanks so much! 

See the Pen GRdJazK by nazarenooviedo (@nazarenooviedo) on CodePen

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