Albert Wagner <al******@tcac.net> writes:
I suspected as much, but I am trapping all keyboard input and not
passing it through. The code traps +/- from the main keyboard but +/-
from the keypad on the right get through, UNTIL the textarea scroll bar
is clicked; then they too are successfully trapped. So, I assume that
you are saying that: "yes, it's a bug in Opera 7.11."
Actually, clicking anywhere in the text area (giving it focus)
prevents the zooming from working.
Not a bug. It is expected behavior. In Opera, the numeric keyboard
keys "+" and "-" have a default behavior, and you do nothing to
suppress it.
If you call the W3C Events DOM method "event.preventDefault()", then
the problem goes away.
Another solution is to change the call to the function to
onKeyPress="return OnKeyPress(event)"
so you further return the false that OnKeyPress returns. This also
prevents the default behavior.
Btw, your code is based on using a global event variable, which is a
bad idea that comes from IE. You should pass the event as an argument
to the handler function. Then it works in Mozilla too.
Also notice that Opera has changed the keyCodes in O7.20, so that it
matches IE and Mozilla, so some of the codes might need to be changed.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'