<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=ISO-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV>Okay I stopped all the events bubbling up but now the DIV events only
trigger intermitantly.</DIV>
<DIV>has anyone got an explanation and/or a workaround for this?</DIV>
<DIV> </DIV>
<DIV>here's my test code:</DIV>
<DIV><BR><DIV ID=menu
onmouseover='document.getElementById("DivStatus").innerHTML+="OVER DIV "'
onmouseout='document.getElementById("DivStatus").innerHTML+="OUT OF DIV - "'
><BR><TABLE ID=t1 WIDTH=120 BORDER=1 CELLPADDING=0
CELLSPACING=0><BR><THEAD></THEAD><BR><TBODY><BR><TR><TD>option
1</TD></TR><BR><TR><TD>option
1</TD></TR><BR></TBODY></TABLE></DIV>
<DIV></DIV></DIV>
<DIV><BR><SCRIPT><BR>function na() {event.cancelBubble=true}<BR>var
t1a=t1.all;<BR>for(x=0;x<t1a.length;x++) {</DIV>
<DIV>
t1a[x].attachEvent("onmouseover",na)}<BR></SCRIPT><BR><P></P><BR><TABLE
WIDTH=600 BORDER=1 CELLPADDING=0
CELLSPACING=0><BR><TR><TD><SPAN
ID=DivStatus>&nbsp;</SPAN></TD></TR><BR></TABLE></DIV>
<DIV> </DIV>
<DIV>regards,</DIV>
<DIV>Lau</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV></FONT>----- Original Message ----- </DIV></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:parkesr1@anz.com" title=parkesr1@anz.com>Parkes, Rohan</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:'javascript@LaTech.edu'"
title=javascript@LaTech.edu>'javascript@LaTech.edu'</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, August 15, 2001 10:51
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Javascript] ONMOUSEOUT
being triggered too many times</DIV>
<DIV><BR></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=878085100-15082001>That
code isn't quite right, sorry;</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=878085100-15082001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=878085100-15082001>What
you need to do is add the cancel code to your event handler, as in
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=878085100-15082001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=878085100-15082001>onmouseover="doFunction(); event.cancelBubble =
true;" </SPAN></FONT></DIV>
<DIV> </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>
Parkes, Rohan [<A
href="mailto:parkesr1@anz.com">mailto:parkesr1@anz.com</A>]<BR><B>Sent:</B> 15
August 2001 10:47<BR><B>To:</B> <A
href="mailto:'javascript@LaTech.edu'">'javascript@LaTech.edu'</A><BR><B>Subject:</B>
RE: [Javascript] ONMOUSEOUT being triggered too many times<BR><BR></P>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px"></FONT>
<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> </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> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=390424200-15082001>event.cancelBubble="true"</SPAN></FONT></DIV>
<DIV> </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><DIV
ID=menu STYLE='position: absolute; left: 200px; top: 300px;visibility:
visible'<BR>onmouseover='alert("in");'
onmouseout='alert("out");'><BR><TABLE WIDTH=120 BORDER=1
CELLPADDING=0
CELLSPACING=0><BR><TR><TD>option1</TD></TR><BR><TR><TD>option2</TD></TR><BR></TABLE><BR></DIV><BR><BR><BR>regards<BR>Lau<BR><BR></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>