Arnaud Diederen (aundro) wrote:
Quote:
I cannot succeed in getting any key event on a div that's been set
invisible by the style's MozOpacity property under firefox. I'm using
this method so that I can capture the mouse events. Unfortunately, it
appears to do so only with mouse events, not key events.
div id="foo"
/div
var foo = document.getElementById ("foo");
foo.style.MozOpacity = 0; |
Quote:
foo.onkeydown = function () {alert ('down');}; |
I don't think Mozilla fires any key events on div elements, whether you
apply any CSS opacity or not. You would need to have a child or
descendant element inside of the div that can receive key events (e.g.
<input type="text"> or <textarea>), then that event might bubble up to
the div if someone types in a text control and can be handled in the
div's key event handler.
--
Martin Honnen
http://JavaScript.FAQTs.com/