so i'm using gsap, scrolltrigger and smoothscrollbar.js with divi theme on wordpress.
let bodyScrollBar = Scrollbar.init(document.querySelector('.scroller'), {
damping: 0.1,
delegateTo: document,
alwaysShowTracks: true,
});
ScrollTrigger.scrollerProxy(".scroller", {
scrollTop(value) {
if (arguments.length) {
bodyScrollBar.scrollTop = value;
}
return bodyScrollBar.scrollTop;
},
});
bodyScrollBar.addListener(ScrollTrigger.update);
using above code, i've initialied smoothscrollbar and a fuction that says scrolltrigger to update scroll position as smoothscrollbar scrolls.
But the problem is that, I cannot use any of divi scroll animations as well as any $(window).scroll() or document.addEventListener('scroll', function() ) functions.
Is there any way where I can tell window to update scroll position just like I've told scrolltrigger to update scroll position.
Thanks in advance.