[Javascript] ONMOUSEOUT being triggered too many times NOT SOLVED

Lau lau at goldenweb.com.au
Tue Aug 14 05:11:32 CDT 2001


Actually I didn't solve it, it just looked solved because the innerHTML statements were overwriting themselves faster than I can see. By concatenating rather than replacing the text I saw that the onmouseout and onmousein are getting triggered every time the cursor goes over a row boundary.

What's the best way around this?

Try this to see what I mean:

<DIV ID=menu  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>trigger DIV & Table</TD></TR>
<TR onmouseover='document.getElementById("row1").innerHTML+=" in row"' onmouseout='document.getElementById("row1").innerHTML+=" out of row -"'>
<TD>trigger Row</TD></TR>
<TR onmouseover='document.getElementById("row2").innerHTML+=" in row"' onmouseout='document.getElementById("row2").innerHTML+=" out of row -"'>
<TD>trigger Row</TD></TR>
</TABLE></DIV>

<TABLE WIDTH=600 BORDER=1 CELLPADDING=0 CELLSPACING=0 onmouseover='document.getElementById("TableStatus").innerHTML="OVER TABLE"' onmouseout='document.getElementById("TableStatus").innerHTML="OUT OF TABLE"' >
<TR><TD WIDTH=50>DIV</TD><TD><SPAN ID=DivStatus>&nbsp;</SPAN></TD></TR>
<TR><TD>TABLE</TD><TD><SPAN ID=TableStatus>&nbsp;</SPAN></TD></TR>
<TR><TD>Row1</TD><TD><SPAN ID=row1>&nbsp;</SPAN></TD></TR>
<TR><TD>row2</TD><TD><SPAN ID=row2>&nbsp;</SPAN></TD></TR>
</TABLE>


regards 
Lau
  ----- Original Message ----- 
  From: Lau 
  To: javascript at LaTech.edu 
  Sent: Tuesday, August 14, 2001 7:40 PM
  Subject: Re: [Javascript] ONMOUSEOUT being triggered too many times SOLVED


  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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010814/5e6e0c55/attachment.htm>


More information about the Javascript mailing list