I have got a setup where I have a set of nested <div> tags and I need to figure out which <div> tag the user is hovering over when an onMouseOver event fires.
I have the following code right now ...
<div id="menuFrame" class="menuFrame" onMouseover="menuEvent(event)">
<div class="menuItem">Menu Item 1</div>
<div class="menuItem">Menu Item 2</div>
<div class="menuItem">Menu Item 3</div>
</div>
Checking event.srcElement.className in IE or e.target.className in NS6 correctly gives me 'menuItem' which is what I want.
I know NS 4 requires some additional code, but here is what I have and I cannot get it to work.
window.captureEvents( Event.MOUSEOVER );
window.onmouseover = function(e)
{ alert(e.target.className);
if (e.target.name.indexOf('menuItem') != -1)
{ menuEvent(e);
}
}
I threw in the alert because the function was never being called. It seems that the alert only fires for the "outer shell" <div> tag. It will not fire for any of the inner <div> tags.
Anybody got any ideas what I am doing wrong here?
Thanks for the help.
-- Jeff
I have the following code right now ...
<div id="menuFrame" class="menuFrame" onMouseover="menuEvent(event)">
<div class="menuItem">Menu Item 1</div>
<div class="menuItem">Menu Item 2</div>
<div class="menuItem">Menu Item 3</div>
</div>
Checking event.srcElement.className in IE or e.target.className in NS6 correctly gives me 'menuItem' which is what I want.
I know NS 4 requires some additional code, but here is what I have and I cannot get it to work.
window.captureEvents( Event.MOUSEOVER );
window.onmouseover = function(e)
{ alert(e.target.className);
if (e.target.name.indexOf('menuItem') != -1)
{ menuEvent(e);
}
}
I threw in the alert because the function was never being called. It seems that the alert only fires for the "outer shell" <div> tag. It will not fire for any of the inner <div> tags.
Anybody got any ideas what I am doing wrong here?
Thanks for the help.
-- Jeff