Overriding onmousewheel event
I have a div element with it's childNodes collection filled with span elements,
div has style.overflow set to auto. I want it to work like a select/listbox.
But trouble is div implements mousewheel scrolling too, like you're scrolling html page and I have some kind of a double scrolling:) . What I want is to disable div's standard mousewheel scrolling (but keep scroll bars).
<div onmousewheel="return false">......</div>
I need to handle onmousewheel, because I do there my own event processing - changing background on items and scrolling.
What I want is to disable div's built in scrolling behavior , I use scrollTop property myself.
For example when user rotates wheel I select (set blue background) on the next or previous span elements in div, to work like listbox/select.
But at the same time div scrolls content itself.
If you use onmousewheel to fire another function, try:
<div onmousewheel="that_function();return false">......</div>
<div onmousewheel="return that_function()">......</div>
Thank you Kor.
You're welcome... Any time here for help, if we are able to :thumbsup:
|All times are GMT +1. The time now is 09:18 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.