I'm building a Woocommerce website and I would like to disable Locomotive Scroll on the Checkout page.
I tried this code, but it doesn't work. How could I disable Locomotive for a specific page? My website is not running with Ajax.
const scroll = new LocomotiveScroll({
el: document.querySelector('[data-scroll-container]'),
smooth: true,
smoothMobile: true,
getSpeed: true,
getDirection: true
});
window.addEventListener("load", function() {
if ($('.woocommerce-checkout').length) {
scroll.stop();
scroll.destroy();
}
});
Thanks!