[Javascript] Need help with IE events - FIXED

Troy III Ajnej trojani2000 at hotmail.com
Tue Jul 12 12:43:45 CDT 2005


I'm not sure why do you have to use the focus for the buttons to be able to 
fire the onclick event?
but if you use onfocus, or onmouseover to set focus and the action value of 
the button you will sulely get into trouble unevitably.
Be carefull how you nest the elements inside your container. The mouseover 
event gets fired over no matter what element you are hovering. The Z-index 
property might solve the problem for you. Get them buttons to be the first 
thing the mouse hovers to.
Because IE will consider any given element as a legitimate element and will 
fire the event for it sometimes covering the other that is near it. It is 
wise not to wrapp button elements in any kind of a container element because 
this container can oftenly receive the focus before other elements contained 
in it and ignore the other as mouse hovers because the mouse is still  over 
the same lemement that first gained the atention. This way the children are 
not asked if they received focus them selves, because their father has 
allready answered for them.
Don't give any css attributes to the container, no borders no background 
color, because the border and the background color will cause that father 
receives all the focus attention. But to keep it simple, try not to use the 
onfocus to set the properties of the button, instead try usin the 
this.onmousedown.



>From: "Mike Dougherty" <mdougherty at pbp.com>
>Reply-To: "\[JavaScript List\]" <javascript at LaTech.edu>
>To: "\[JavaScript List\]" <javascript at LaTech.edu>
>Subject: Re: [Javascript] Need help with IE events - FIXED
>Date: Mon, 11 Jul 2005 15:53:23 -0400
>
>I tried various ways of hooking up the onclick/onmouseover events, 
>including setting the attributes in HTML.  I read countless google hits 
>looking for insight.  Eventually I tried: document.onmouseover = function() 
>{ window.status = event.srcElement.id }
>
>I noticed that when the event failed, the ID in the status bar did not 
>belong to the button. After putting a border around the offending 
>element(s) it was easy to see what was happening. There was an empty <li> 
>taking space in IE, (but not Firefox) which I earlier 'fixed' by moving the 
><ul> up.  The <ul> was obscuring the bottom half of the buttons on the nav 
>bar.  Since the <ul> appears second in source order, it was effectively on 
>top of the buttons - so the buttons were not receiving focus/clicks.  
>Apparently I tend to aim towards the top of the text (and primarily use 
>Firefox) and my boss must be clicking towards the bottoms of the buttons.
>
>I guess the moral of the story is that when you shoot yourself in the foot, 
>sometimes it takes a while to register the pain.  :)
>
>On Mon, 11 Jul 2005 10:22:03 -0300
>  "Allard Schripsema" <allard-schripsema at procergs.rs.gov.br> wrote:
>>Hi Mike,
>>
>>I did see the problem. I clicked , button didn´t work,
>>went to other button, went back, clicked, worked.
>>Could be anything, from reusing a global variable which lost value to a 
>>bug
>>in IE (I use IE 6.0.2900,2180).
>>
>>I hope that diminuishing the "scope", you still can reproduce the error.
>>If not, it will be hell to find the bug....
>>
>>Waiting for the code,
>>allard
>>www.VisualDigital.com.br
>>
>>-----Original Message-----
>>From: javascript-bounces at LaTech.edu
>>[mailto:javascript-bounces at LaTech.edu]On Behalf Of Mike Dougherty
>>Sent: Monday, July 11, 2005 10:12 AM
>>To: [JavaScript List]
>>Subject: Re: [Javascript] Need help with IE events
>>
>>
>>If I can reproduce this behavior with a simpler case, I will.  I posted 
>>this
>>example just so
>>someone could see the behavior.  I'm guessing the problem is in the
>>complexity of attaching events
>>through too many function calls.  I'll be working on it more today.
>>
>>Did you at least see the problem?
>>
>>On Mon, 11 Jul 2005 08:55:52 -0300
>>  "Allard Schripsema" <allard-schripsema at procergs.rs.gov.br> wrote:
>>>Hi Mike,
>>>I´m trying to understand your code, but seriously, copying include files
>>>from cache isn´t my favorite activity.
>>>Can you send a simplified example of this situation so that we can see 
>>>the
>>>code properly instead of guessing which include  does what?
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the Javascript mailing list