Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
Automatic horizontal 100vw scroll when mousewheel scrolling

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();
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!