Thanks Zvonko,
but I only put an Asp.net label on my panel (so without onmouseover or onmouseout event) and when the mouse hovers the label, the panel onmouseout event is raised !
I found a code which seems to solve the problem,but it doesn't work with Firefox:
<html>
<head>
<title>onmouseenter/leave for IE4+, Netscape 6+, Opera 7</title>
<script type="text/javascript">
function containsDOM (container, containee) {
var isParent = false;
do {
if ((isParent = container == containee))
break;
containee = containee.parentNode;
}
while (containee != null);
return isParent;
}
function checkMouseEnter (element, evt) {
if (element.contains && evt.fromElement) {
return !element.contains(evt.from
}
else if (evt.relatedTarget) {
return !containsDOM(element, evt.relatedTarget);
}
}
function checkMouseLeave (element, evt) {
if (element.contains && evt.toElement) {
return !element.contains(evt.toEl
}
else if (evt.relatedTarget) {
return !containsDOM(element, evt.relatedTarget);
}
}
</script>
</head>
<body>
<div style="border: 1px solid green;"
onmouseover="if (checkMouseEnter(this, event)) {
//window.status = event.type;
this.innerText=event.type;
}"
onmouseout="if (checkMouseLeave(this, event)) {
//window.status = event.type;
this.innerText=event.type;
}">
Kibology for all.
<br>
<a href="http://www.kibo.com/
<br>
All for Kibology.
</div>
<hr>
<div style="border: 1px solid green;"
onmouseout="if (checkMouseLeave(this, event)) {
this.style.visibility = 'hidden';
}">
This div element with the green border gets hidden when the mouse
leaves the div.
<div style="border: 1px solid blue;">
Child div with blue border.
</div>
Kibology for all.
</div>
<hr>
<div style="border: 1px solid green;"
onmouseover="if (checkMouseEnter(this, event)) {
this.style.visibility = 'hidden';
}">
This div element with the green border gets hidden when the mouse enters
the div.
<div style="border: 1px solid blue;">
Child div with blue border.
</div>
Kibology for all.
</div>
</body>
</html>
Main Topics
Browse All Topics





by: ZvonkoPosted on 2006-10-10 at 06:36:11ID: 17698644
Normaly are child elements propogating the events to its parent. Therefore normaly you need only in the topmost element the mouse event handler. Your effect does say that you have also event handlers in the child elements which kill the event bubbling to parent element.
Look for the elements structure in html page source or if it is created dynamicaly you can use PageSpy: http:/M_1344026.html