Share Posted October 14, 2020 Hello everyone, thanks guys for gsap and all about it. I use barba + locomotive + gsap on my project, i try to destroy all ScrollTriggers with ScrollTrigger.getAll().forEach((trigger) => trigger.kill()); But i have some errors from ScrollerProxy, and i think my code doesnt destroy all ScrollTriggers, especially scrollerProxy. There my code for scrollerProxy, almost duplicate from docs if (scrollContainer) { window.locoInstance.on('scroll', ScrollTrigger.update); ScrollTrigger.scrollerProxy(scrollContainer, { scrollTop(value) { return arguments.length ? window.locoInstance.scrollTo(value, 0, 0) : window.locoInstance.scroll.instance.scroll.y; }, getBoundingClientRect() { return { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight }; }, pinType: scrollContainer.style.transform ? 'transform' : 'fixed', }) } There error Uncaught TypeError: Cannot read property 'scroll' of null at ScrollTrigger.scrollTop [as scroll] at _updateAll Sorry for my english, sorry it's not codepen, and if it's something stupid, i just tired and don't know why and how to fix this, thanks Link to comment Share on other sites More sharing options...
Share Posted October 14, 2020 Hey Roman and welcome to the GreenSock forums. It's really hard to debug blindly. Can you please make a minimal demo of the issue? 1 Link to comment Share on other sites More sharing options...
Author Share Posted October 15, 2020 21 hours ago, ZachSaucier said: Hey Roman and welcome to the GreenSock forums. It's really hard to debug blindly. Can you please make a minimal demo of the issue? I'm not sure, how i can use barba on codepen, where shoul redirect links, but i don't ask for debug, main question its how i can fully destroy script for scrollerProxy Link to comment Share on other sites More sharing options...
Share Posted October 15, 2020 It looks like you might be using Locomotive Scroll? So is your question how to kill the Locomotive Scroll instance? It has a .destroy() method if so. If that's not what you're looking for I don't understand what you are looking for. A demo would help us understand and better be able to help. 1 Link to comment Share on other sites More sharing options...
Author Share Posted October 16, 2020 13 hours ago, ZachSaucier said: It looks like you might be using Locomotive Scroll? So is your question how to kill the Locomotive Scroll instance? It has a .destroy() method if so. If that's not what you're looking for I don't understand what you are looking for. A demo would help us understand and better be able to help. Im use barba first time, and i think my scripts failed w/o errors on console, and locomotive doesnt destroy because script failed before destroy, and I get some scrollTrigger errors, and think I need destroy locomotive scroll and scrollerProxy, thank you for help, i'm just confused, but now I found reasons why I get this errors Link to comment Share on other sites More sharing options...
Share Posted October 27, 2020 You may create a project with two or more pages in codepen. Create a demo, I am also interested in this issue. On 16.10.2020 at 06:31, Roman Baranov said: Я использую barba в первый раз, и я думаю, что мои скрипты не прошли без ошибок на консоли, а локомотив не уничтожается, потому что скрипт завершился неудачно до уничтожения, и я получаю некоторые ошибки scrollTrigger и думаю, что мне нужно уничтожить прокрутку локомотива и scrollerProxy, спасибо за помощь , я просто запутался, но теперь я нашел причины, по которым у меня появляются эти ошибки Link to comment Share on other sites More sharing options...
Share Posted November 2, 2020 Hey guys, helpless me again I´ve made this codepen to abstract my problem, which solves my initial problem of disabling multiple gsap-instances when switched to some other scroll reference. very useful! Now I´m facing quite the same issue as described above, but by using asscroll library. In the example it´s not refreshing the gsap params if you open the overlay by clicking one of these boxes. See the Pen yLJKBpw by rkxn (@rkxn) on CodePen Can you please check if this is the right way to implement scrollerProxy? stay safe, Best, Richard Link to comment Share on other sites More sharing options...
Share Posted November 2, 2020 Hey Richard. You created a scrollerProxy for the smooth-scroll element but your overlays have their own scroller. So you need to create a scrollerProxy for those as well: See the Pen ExyLBvP?editors=0010 by GreenSock (@GreenSock) on CodePen 2 Link to comment Share on other sites More sharing options...
Share Posted November 3, 2020 15 hours ago, ZachSaucier said: Hey Richard. You created a scrollerProxy for the smooth-scroll element but your overlays have their own scroller. So you need to create a scrollerProxy for those as well: oh , so close. absolutely smashing how good gsap and you guys performing at this ❤️ thanks for the fast answer! 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