PDA

View Full Version : Possible to disable mousewheel?



boogily
Jan 7th, 2010, 04:13 PM
I have a website that contains a large div inside a smaller div, only to be scrolled via javascript. The problem is when you mouseover the smaller (container) div and you scroll the mousewheel down, everything scrolls down. I've been searching for a while and haven't got any answers.

www.designbyryanboog.com/spa (site only works in IE8, Chrome, Safari, Opera, Firefox<slowly>)

Thanks in advance:thumbsup:

itsallkizza
Jan 7th, 2010, 04:32 PM
Attempting to disable the mouse wheel scroll is not the way to go. A more appropriate approach would be to find out how to code the page in such a way so that the default OS and browser controls work the way they are supposed to.

If you can be more specific about which div(s) you are talking about and exactly how you want the client mouse to behave, I can help you modify your html so your site functions the way you want.

Kor
Jan 7th, 2010, 06:04 PM
Well, there is a situation when the mousewheel might bring trouble: when the user selects an option (within a select element) then use the mouse wheel to go down the page, without focusing previously the document. He might not notice that he scrolled the options instead, thus he might submit wrong data afterwards.

There are partial solves for that. For instance:


<tag onmousewheel="return false">

But I suspect it will work only in IE and Opera.

itsallkizza
Jan 7th, 2010, 06:29 PM
Well, there is a situation when the mousewheel might bring trouble: when the user selects an option (within a select element) then use the mouse wheel to go down the page, without focusing previously the document.
In my humble opinion, this *mistake* is on the user. It is best to assume the user's commands are intentional and develop your application/website accordingly. That is one reason why so many developers are strict on standards and shy away from hacks such as disabling default browser functions. Let's say you are able to successfully disable the mouse scroll for the drop-down in question in all browsers; how then does a user who knows what they are doing scroll the drop-down to view hidden options?

Kor
Jan 7th, 2010, 08:55 PM
In my humble opinion, this *mistake* is on the user.
Well, you know, don't sub estimate the power of an average user to do exactly the last thing you would expect of. :D

itsallkizza
Jan 7th, 2010, 08:58 PM
Heh, /agree on that one :)

Kor
Jan 7th, 2010, 09:19 PM
I remember that a client claimed once that if he clicks very very quickly eleven times on some tag, something, not important but a little bit weird thing happens. Could have been his computer, his browser, his OS bug... how should I know? I was laughing and I told him that no healthy minded person has any reason to click very very quickly eleven times on something.

Since then I have gained an enemy. :D