Jump to content
Search Community

ScrollSmoother get scroll y value without adding transform to content

FrankLaRocca test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hi, I'm trying to add smooth scroll to a site that already has a CSS translate on the body content. It needs this to be able to create the illusion of pausing the scroll at certain points to trigger an animation on the logo, which is also based on scroll position (so I don't think the .paused() method will work). Unfortunately, I can't share a public link of the project. Is there a way to just get the calculated scrollY (or scrollTop) value with easing, but not have ScrollSmoother apply any transformations to the content? Thanks!

Link to comment
Share on other sites

  • Solution

Without a minimal demo, it's super difficult to offer a suggestion here or understand what you're asking for - are you saying you want to apply ScrollSmoother...but not have it actually work at all? You just want to have it pretend to work, feeding you the value that it would apply to the container's transform, without applying it? Maybe you could add a ticker listener with a high priority to grab the original transform, and then use an onUpdate on the ScrollSmoother where you grab the new value but immediately apply the old one to revert it(?) I'm totally guessing here in the absence of a minimal demo, but hopefully that gives you a little to go on at least. I wonder why you wouldn't adjust whatever you're doing with the <body> transform to more cleanly apply that in a way that integrates with ScrollSmoother(?) 

Link to comment
Share on other sites

Thanks, that's helpful. I went with the second suggestion and refactored my scroll effects to use the regular ScrollSmoother body transform. I was also able to use pinning to achieve the "pause" effect.

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