Hello,
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.
Is there a better solution than the following? :
-----------------------------
<html>
<head>
<title>Event test..</title>
</head>
<body>
<div style="border: 3px solid green;">
<div id="foo">
</div>
</div>
<script>
var foo = document.getElementById ("foo");
foo.style.MozOpacity = 0;
foo.style.filter = "alpha(opacity=0)";
foo.style.backgroundColor = "red";
foo.style.width = "100%";
foo.style.height = "100px";
foo.onmouseover = function () {alert ('over');};
foo.onmouseout = function () {alert ('out');};
foo.onkeydown = function () {alert ('down');};
</script>
</body>
</html>
-----------------------------
As you'll notice, the mouse events will be fired, but not the key*
events.
Note: The code works under IE (I can reach the same effect as the
'MozOpacity' property by the 'filter' property)
Many thanks for any advice!
Best regards,
Arnaud
--
Arnaud DIEDEREN
Software Developer
IONIC Software
Rue de Wallonie, 18 - 4460 Grace-Hollogne - Belgium
Tel: +32.4.3640364 - Fax: +32.4.2534737
mailto:ad@ionicsoft.com
http://www.ionicsoft.com