aroca
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by aroca
-
-
Hi,
im tying to use scrollProxy with locomotive like in the docs with Nextjs. Locomotive works fine but scrollTrigger its always at the initial position. It seams that the scrollTop inside the scrollerPoxy its not returning any value. I made a codesandbox to show the case:
Scroll component:
https://codesandbox.io/s/nextjs-gsap-locomotive-qq11t?file=/src/components/scroll.jsx
Live demo:https://qq11t.sse.codesandbox.io/
I'm looking for a good way to implement a smooth-scroll in nextjs so if any have an alternative to locomotive and works with gsap it would help any way.
Thx, for the support
ScrollProxy with Locomotive & Nextjs
in GSAP
Posted
Hi, thx for the answer.
This is what I have to sync scrollTrigger with locomotive:
src/components/scroll.jsx
The docs shows a similar example but it seems that the scrollTop() is not working. This "console.log(locoScroll.scroll.instance.scroll.y);" is working on the example but not there, thats what it makes me think that is something that i made in the wrong way with the scrollProxy.
The animation is here:
And it works perfect without locomotive.
What I expect its that scrollTrigger takes the scroll position of locomotive instead of the main scroll as its 0 always with the overfllow: hidden of the body.
Thx for the help, I'll keep searching 😊