Jump to content
Search Community

Resize issue on scrolltrigger with scrollerproxy

Studio Gusto
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Studio Gusto
Posted

Hi all, in my project where I instantiate lenis in a container and not in the body as by default, when I resize the window it seems that scrolltrigger is unable to calculate the new start & end correctly, did I do something wrong in the scrollerProxy configuration?

See the Pen QwLQyMw by friconelli (@friconelli) on CodePen.

  • Solution
GreenSock
Posted

Thanks for being a Club GSAP member, @Studio Gusto

 

Lenis isn't a GreenSock product so we can't really support it here (I'm pretty unfamiliar with it), but it looks like you neglected to properly handle setting the scrollTop in your proxy (you only handled getting): 

See the Pen OPLQbYm?editors=0010 by GreenSock (@GreenSock) on CodePen.

 

Does that help? 

  • Like 2
Studio Gusto
Posted

That was exactly the problem, thank you!

  • 2 weeks later...
Posted

Hi guys, thanks for this one, a huge help on a current project, got a question, it seems that Lenis with this setup dont detect touch scroll on mobile, so on my phone I am not able to scroll. ( on desktop everything work well ) 

If I test the codepen : 

See the Pen YPKJYgy by aronanol (@aronanol) on CodePen.

 with chrome mobile simulator, I cannot scroll with touch action trough the page

Thanks

Posted

Hi,

 

I just tested the debug version of the codepen demo you posted on an android phone (chrome/firefox) and an iPad (chrome/safari) and is working as expected.

 

I wouldn't trust the results of chrome's mobile emulator especially on the preview of a codepen, since is not really a device and the codepen preview has some iframes in place that makes codepen works the way it does. Is always a better idea to try on real devices.

 

Happy Tweening!

  • Thanks 1
Posted

I got a css error, everything works like a charm. Thanks guys for this little gem!!! ❤️ 

  • Like 1
Posted

Got just a question @Rodrigo , is it a way to normalize the scroll while using a proxy ? 

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