darkgr33n's post in Scroll Trigger - ASScroll - pinning was marked as the answer
Thanks for the quick reply Zach -- I only realised as I got to the end of the question!
OK, so I can get it to work if I do this:
ScrollTrigger.matchMedia({
// please don't touch
"(pointer: fine)": function() {
ScrollTrigger.defaults({
scroller: '.inner'
})
}
});
Does that seem reasonable ?
The whole ASScroll call now being:
// ASScroll
var asscroll = new ASScroll.default({
customScrollbar: true,
disableOnTouch: true,
scrollbarHandleEl: '.my-scrollbar-handle',
disableNativeScrollbar: true
});
ScrollTrigger.matchMedia({
// please don't touch
"(pointer: fine)": function() {
ScrollTrigger.defaults({
scroller: '.inner'
})
}
});
ScrollTrigger.scrollerProxy(".inner", {
scrollTop(value) {
return arguments.length ? asscroll.scrollTo(value) : -asscroll.smoothScrollPos;
},
getBoundingClientRect() {
return { top: 0, left: 0, width: window.innerWidth, height: window.innerHeight }
}
});
asscroll.on("raf", ScrollTrigger.update);
ScrollTrigger.addEventListener("refresh", () => asscroll.onResize());
window.addEventListener("load", () => {
var totalScroll = document.querySelector(".asscroll-container").scrollHeight - innerHeight;
asscroll.enable(false, true, document.querySelector(".inner"));
});
Cheers!