HighDots Forums  

Re: Key events in invisible (by -Moz-Opacity) div (Mozilla)

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Key events in invisible (by -Moz-Opacity) div (Mozilla) in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Honnen
 
Posts: n/a

Default Re: Key events in invisible (by -Moz-Opacity) div (Mozilla) - 08-01-2006 , 09:17 AM








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/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.