<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.00.3103.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=390424200-15082001>What's 
wrong is that you have the event-handler at the top of an element tree. You have 
to take into account the event-bubbling behaviour of IE - events bubble up from 
lower elements to higher ones. Consequently, the table elements generate their 
own events, which are cpatured by the onmoueout in the top 
DIV.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=390424200-15082001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=390424200-15082001>Unfortunately, you can't turn event-bubbling off at the 
top level, as you can in NS (one of NS's very few advantages over IE). Instead, 
you have to add an attribute to each lower element whose event bubble you want 
to disable:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=390424200-15082001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=390424200-15082001>event.cancelBubble="true"</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<P><FONT color=#000000 face=Tahoma size=2>Rohan Parkes</FONT> </P>
<P><BR><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Lau 
[mailto:lau@goldenweb.com.au]<BR><B>Sent:</B> 14 August 2001 19:06<BR><B>To:</B> 
javascript@LaTech.edu<BR><B>Subject:</B> [Javascript] ONMOUSEOUT being triggered 
too many times<BR><BR></P>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px"></FONT>
  <DIV><FONT face=Arial size=2>Hi all,<BR><BR>How do I get around this 
  problem?<BR>I have a DIV with a TABLE in it that I'm using as a popup 
  menu.<BR>Its initially HIDDEN and becomes VISIBLE when the cursor moves over a 
  link.<BR>So when the mouse leaves the DIV I want the menu to become HIDDEN 
  again.<BR>Sounds easy but the problem is that I'm getting the ONMOUSEOUT event 
  being triggered when the cursor<BR>moves from one table row to the next, 
  followed by another ONMOUSEOVER as it enters the next row.<BR><BR>Here's 
  sample code demonstrating the problem:<BR><BR>&lt;DIV ID=menu STYLE='position: 
  absolute; left: 200px; top: 300px;visibility: 
  visible'<BR>onmouseover='alert("in");' 
  onmouseout='alert("out");'&gt;<BR>&lt;TABLE WIDTH=120 BORDER=1 CELLPADDING=0 
  CELLSPACING=0&gt;<BR>&lt;TR&gt;&lt;TD&gt;option1&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;TR&gt;&lt;TD&gt;option2&lt;/TD&gt;&lt;/TR&gt;<BR>&lt;/TABLE&gt;<BR>&lt;/DIV&gt;<BR><BR><BR>regards<BR>Lau<BR><BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>