Ivan Mocs Posted September 18, 2022 Share Posted September 18, 2022 i have problem with scrub position when window is resized, i found the code in this forum, by using scrolltrigger.create the problem is solved but when i move page the autoalpha position immediately becomes 0, without any transition. i am using gsap.timeline and i am getting error in code scrubNavHide.scroll See the Pen MWGpMOZ by adeivan (@adeivan) on CodePen Link to comment Share on other sites More sharing options...
GSAP Helper Posted September 18, 2022 Share Posted September 18, 2022 It looks like your demo doesn't have any HTML or CSS in it, so it's rather useless. Can you please provide a proper minimal demo so we can see the issue in context? This definitely looks wrong: nav_hide.scroll(...) That's a timeline which doesn't have a "scroll()" method. Perhaps you meant nav_hide.scrollTrigger.scroll(...)? Link to comment Share on other sites More sharing options...
Ivan Mocs Posted September 18, 2022 Author Share Posted September 18, 2022 9 hours ago, GSAP Helper said: It looks like your demo doesn't have any HTML or CSS in it, so it's rather useless. Can you please provide a proper minimal demo so we can see the issue in context? This definitely looks wrong: nav_hide.scroll(...) That's a timeline which doesn't have a "scroll()" method. Perhaps you meant nav_hide.scrollTrigger.scroll(...)? See the Pen oNdWXqm by adeivan (@adeivan) on CodePen this is the code, when windows is resized, the autoalpha value changes Link to comment Share on other sites More sharing options...
Solution GreenSock Posted September 18, 2022 Solution Share Posted September 18, 2022 This is a LocomotiveScroll issue, unrelated to GSAP/ScrollTrigger. Please keep in mind that LocomotiveScroll is not a GreenSock product so we cannot support it. Here's a fork of your CodePen proving that when you try to call the scrollTo() method of LocomotiveScroll, it doesn't actually work properly (read the console): See the Pen YzLVpoK?editors=0010 by GreenSock (@GreenSock) on CodePen Also note that your previous demo was using the older LocomotiveScroll API for the scrollTo() method, but it looks like they updated it in v4 to have a different API (I fixed that in my fork above). You might want to consider using ScrollSmoother which is a GreenSock product and doesn't have these problems. https://greensock.com/scrollsmoother 👍 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now