I have an onmousewheel event on some object onmousewheel

 <input type="number" min="0" max="23" step="1" required="required" placeholder="hour" name="s_hour" value="13" onmousewheel="foo(this,event)"> 

We see that when the wheel is triggered on the object, the function foo(obj,event) triggered.

And then there are 3 questions

  1. How to make sure that when the wheel is triggered, the page, or rather the <div> with overflow:scroll does not scroll (or down) neither down nor up?
  2. How to find out which way the wheel worked (up / down)?
  3. How to find out how much it worked (1 scroll down, 2 scroll up)?

I know there is a good jQuery.mousewheel plugin on jQuery, but I don't need a plugin.

The scroll should not be removed, but “frozen” so that it does not work

Help me please!

ZY The main thing is to work in Google Chrome.

2 answers 2

 onscroll="return false" 
  • One question answered. But I’ll correct onmousewheel = "foo (this, event); return false" - Vitaly Zaslavsky

The scroll should not be removed, but “frozen” so that it does not work

It is important to remember that the scrolling of the page can still be controlled by arrows and space!

Here's what you can google on request disable scrollbar .

  • You read the question badly. As for the freezing, everything is settled with a return return - Vitaly Zaslavsky