Click to See Complete Forum and Search --> : Error in Mozilla ?


Yogg
07-25-2003, 02:28 PM
Hi,

I'm experiencing some problems with mozilla 1.3/4 implementing a dropdown menu. Check an example of the bug i'm talking about on http://www.jeuxvideos.com. Don't care about the language and focus on the dropdowns menus.
In mozilla navigator, the onClick event existing in each items of those menus doesn't work. Instead, it's the onMouseOut event wich is called.

Here is a sample:

<script language="javascript">
function hide(id) {
document.getElementById(id).style.visibility = 'hidden';
}
function show(id) {
document.getElementById(id).style.visibility = 'visible';
}
</script>

<input type="button" onClick="show('div1')" value="show div">
<br><br><br>

<div id="div1">
<table cellpadding="0" cellspacing="0" border="0" width="100" onMouseOut="hide('div1')" bgcolor="#99DCFF">
<tr>
<td>
<table width="100%" onMouseOver="show('div1')">
<tr>
<td onclick="alert('clic !')">item</td>
</tr>
</table>
</td>
</tr>
</table>
</div>

When you roll out of the div, it disappears with the hide function called by the onMouseOut event. But why does the onClick event of the cell calls that onMouseOut ??? My cell is supposed to be a link !!!! So i can't work it out. I just mention again that i'm experiencing this problem with mozilla and not IE.

Thanks for your suggestions !!!

Yogg

Nevermore
07-25-2003, 02:30 PM
Where is the drop down menu?

Yogg
07-25-2003, 02:37 PM
In made a sample just to show the problem. This sample is not a real dropdown of course, but here to show the problem with the onClick event and the onMouseOut.
My code is far too long to be put here.
Of course the "dropdown" has no motion but is based on the visible/hidden property.

Yogg
07-25-2003, 02:50 PM
And i just found that if, instead of the onClick event you put an "a href" link or a button, they won't work either because of the onMouseOut.

Any explication ?

Yogg
07-25-2003, 04:08 PM
So nobody has ever encountered this bug nor is able to explain it ?

Nevermore
07-27-2003, 11:38 AM
I use Mozilla and have done for around a year. I make several JavaScripts a day, including many using event handlers, and have never found a bug in Mozilla. I have a feeling it could be your code.

Yogg
07-28-2003, 01:37 PM
Then take a look at the simple code above and tell me where is the bug !!!!!! There aren't many lines to read...

Nevermore
07-28-2003, 01:56 PM
Ive run the code in Mozilla and in IE, and here is what I see:

According to the logic of the statements, this is what should happen:

When you put your mouse on the div: Div appears
When you move your mouse off the div:
Div disappears
When you click the show button:
Div appears
When you click the link:
Alert appears

In Mozilla, this happens:

When you put your mouse on the div: Div appears
When you move your mouse off the div:
Div disappears
When you click the show button:
Div appears
When you click the link:
Alert appears

In IE, this happens:

When you put your mouse on the div: Div appears
When you move your mouse off the div:
Div disappears
When you click the show button:
Div appears
When you click the link:
Alert appears and div vanishes

So you see, what I find is that it is IE, not Mozilla, that is treating this incorrectly. Which part is it treating wrongly, because I'm just not seeing it.

Yogg
07-28-2003, 02:26 PM
Thanks for the test...
I don't get it... Mozilla 1.3 and 1.4, on my computer don't show the alert with EXACTLY the same code....
I suppose you're using 1.4 so i'm tricked.....

Nevermore
08-01-2003, 04:20 AM
Yeah I'm on 1.4.