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