i have a horizonal scrolling website, and i want that when the user scroll with the mousewheel (even a little scroll), the page will automaticaly scroll horizontaly (100vw).
I tryed to create this js script, but it only work with px value. So i tried to put an outerWidth or innerWidth, but the scroll isn't perfect, it have a litthe offset...
const mouseWheel = document.getElementById("carousel");
mouseWheel.addEventListener('wheel', function(e) {
const race = window.outerWidth; // How many pixels to scroll
if (e.deltaY > 0) // Scroll right
mouseWheel.scrollLeft += race;
else // Scroll left
mouseWheel.scrollLeft -= race;
e.preventDefault();
});