detect a onmouseout on IFRAME

detect a onmouseout on IFRAME

Post by Allar » Sat, 07 Feb 2004 02:58:39


I have an IFRAME showing a ctxmenu. I want to detect the event that the
mouse goes out of the IFRAME. (to set a timer to automatically close the
ctxmenu).

In IE I can test : event.toElement on the document.onmouseout event. If
it is null then I know the mouse is moved out of the window.

What is the way to do this in Mozilla? It seems that the
document.onmouseout is not always triggered (when there are items
without any margin to the edge of the IFRAME).

Please help...

See a test page below:

<html><head><title>Testpage</title></head>
<script language=javascript>
window.onload=handle_onload;
function handle_onload() {
if (navigator.appName!="Netscape") {
//' for IE browser
fraTest.document.onmouseout=function () {
if (!this.parentWindow.event.toElement) {
document.getElementById
("spnMessages").innerHTML+="mouseout<BR>";
}
}
} else {
//' how ?!?!
}
}
</script>
<body>


<iframe id=fraTest name=fraTest></iframe>

<br><strong>Messages:</strong><Br>
<div id=spnMessages></div>
</body>
</html>
 
 
 

1. button and an iframe : onmouseout

2. DIV/IFRAME hide/show problem onMouseOut - please help :)

I have the following scritpt. It hides div layer when mouse is out of
the div layer. Inside DIV I have IFRAME box. Unfortuantely it does not
work in Mozilla or IE 5.5. It hides div when cursor is inside IFRAME.
NOte that IFRAME is inside DIV so it should not hide DIV. It Works
fine in IE6.0.

Could any one help?

Example:

<html>
<head>
<script type="text/javascript">
function hide() {
obj = document.getElementById('testDiv');
obj.style.visibility = 'hidden';
}
function show() {
obj = document.getElementById('testDiv');
obj.style.visibility = 'visible';
}
</script>
<head>
<body>
<form action="">
<input type="button" value="Show" onclick="show()">
</form>
<div id="testDiv" style="border: 10px solid red;" onmouseover="show()"
onmouseout="hide()">
<p>Text inside DIV</p>
<iframe id="testIframe"></iframe>
</div>
</body>

3. Get form values from iframe (1) to iframe (2) inside a layer in iframe (1)

4. Reliably detect when an iframe has loaded?

5. Detect events in an editable iframe

6. Detect which IFrame is trying to change the top level document href/URL?

7. having trouble with event listener: detect iframe close event from parent

8. Detect Browser - switch to iframe or url as page loads

9. Detecting empty in an IFrame

10. How to detect which iframe is active

11. Detecting if an iframe's parent has finished loading

12. Detect page called in IFRAME

13. How to detect the change of TITLE element in nested IFRAME?

14. How to detect iframe's doc change/loading ?

15. Detecting right clic into the iframe