After successfully implementing locomotive scroll on my website, I encountered some issues when uploading it to a live server. Elements started bumping into each other causing flickering and disappearing, with the footer being cut off as well. It appears that the positioning of elements is not updating correctly during scrolling, leading to this glitch.
I suspect that this could be a loading issue, as sometimes everything works fine and resizing the browser can temporarily fix the problem. Perhaps I need to trigger an update() on the scroll after all elements have loaded.
I'm exploring ways to modify the code snippet below so that it verifies if the page's DOM has fully loaded instead of relying on a timeout function for the check.
function smooth() {
let scrollContainer = document.querySelector('your-selector');
scroll = new LocomotiveScroll({
el: scrollContainer,
smooth: true
});
setTimeout(() => {
scroll.update();
}, 500);
}