Hi @elegantseagulls,
Thank you for getting back to me so quickly and looking into the issue. In my codepen example I'm using the disable() functionality on the click event of the "back-to-top" button and then onComplete of the scroll using enable() functionality.
// Scroll to top Button
const scrollTopBtn = document.querySelector('.btn-top');
var enableGsap = function () {
ScrollTrigger.getAll().forEach(test => test.enable());
}
scrollTopBtn.addEventListener('click', function () {
ScrollTrigger.getAll().forEach(test => test.disable());
gsap.to(window, {
duration: 1.5,
scrollTo: {
y: 0,
x: 0,
autoKill: true
},
onComplete: enableGsap
});
});
Let me know if I'm doing something incorrectly.
Thanks!