The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript toggle mousewheel scrolling

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #168204

    I want to disable mousewheel scrolling when the cursor is over a div, and re-enable mousewheel scrolling when it leaves the div. How can i achieve this?

    Alan C

    I don’t believe this is possible. You could potentially look into preventing page scrolling period though.


    You can, here you go:

    Whenever the cursor is above the div, that div receives the mousewheel event before the rest of the page. Just preventDefault() and no scrolling will happen.

    Be aware that my code uses the jQuery mousewheel plugin:

    It can also be done with native JS, but that would be your job to find the neccessary code .

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.