I have some input elements that the users are request special behavior on pageup / pagedown keys to modify value in input element. What the users do not want is to have the scrolling region they are editing in also do a page up/down scroll. I have it working correctly in Firefox and IE8.
However, in Chrome, I cannot find a way to prevent the browser itself from using these keyboard events to scroll the region. Before anyone suggests it, calling e.stopPropagation() or e.immediateStopPropagation() does not solve the problem in Chrome. It works fine in Firefox and IE8.
Also, the page up/down behavior is to only modified for these special input fields. For all others, page up/down is to work normally.
You can see a working demo at http://jsfiddle.net/photo_tom/CN4UZ/.
I used
e.preventDefault(). Works in Chrome 16.http://jsfiddle.net/CN4UZ/5/