[Javascript] ONMOUSEOUT being triggered too many times SOLVED

Lau lau at goldenweb.com.au
Tue Aug 14 04:40:46 CDT 2001


Okay please ignore my question. I've discovered the problem.
My alert statements were triggering the ONMOUSEOUT event.

I discovered this when I replaced them with innerHTML stements.
If anyone is interested heres some code showing how the ONMOUSEOUT is triggered from the DIV, TABLE and TR 

<DIV ID=menu STYLE='position: absolute; left: 200px; top: 300px;visibility: visible' onmouseover='document.getElementById("DivStatus").innerHTML="OVER DIV"' onmouseout='document.getElementById("DivStatus").innerHTML="OUT OF DIV"' >
<TABLE WIDTH=120 BORDER=1 CELLPADDING=0 CELLSPACING=0 onmouseover='document.getElementById("TableStatus").innerHTML="OVER TABLE"' onmouseout='document.getElementById("TableStatus").innerHTML="OUT OF TABLE"' >
<TR><TD><SPAN ID=DivStatus>DIV</SPAN></TD></TR>
<TR><TD><SPAN ID=TableStatus>TABLE</SPAN></TD></TR>
<TR onmouseover='document.getElementById("row1").innerHTML="in row"' onmouseout='document.getElementById("row1").innerHTML="out of row"'>
<TD><SPAN ID=row1>option1</SPAN></TD></TR>
<TR onmouseover='document.getElementById("row2").innerHTML="in row"' onmouseout='document.getElementById("row2").innerHTML="out of row"'>
<TD><SPAN ID=row2>option2</SPAN></TD></TR>
</TABLE></DIV>


Sorry about the inconvenience.
LAU
  ----- Original Message ----- 
  From: Lau 
  To: javascript at LaTech.edu 
  Sent: Tuesday, August 14, 2001 7:05 PM
  Subject: [Javascript] ONMOUSEOUT being triggered too many times


  Hi all,

  How do I get around this problem?
  I have a DIV with a TABLE in it that I'm using as a popup menu.
  Its initially HIDDEN and becomes VISIBLE when the cursor moves over a link.
  So when the mouse leaves the DIV I want the menu to become HIDDEN again.
  Sounds easy but the problem is that I'm getting the ONMOUSEOUT event being triggered when the cursor
  moves from one table row to the next, followed by another ONMOUSEOVER as it enters the next row.

  Here's sample code demonstrating the problem:

  <DIV ID=menu STYLE='position: absolute; left: 200px; top: 300px;visibility: visible'
  onmouseover='alert("in");' onmouseout='alert("out");'>
  <TABLE WIDTH=120 BORDER=1 CELLPADDING=0 CELLSPACING=0>
  <TR><TD>option1</TD></TR>
  <TR><TD>option2</TD></TR>
  </TABLE>
  </DIV>


  regards
  Lau


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010814/845c695c/attachment.htm>


More information about the Javascript mailing list