PRB: document_onmouseout Fires When Mouse is Over HTML FormID: Q185374
|
The document_onmouseout event fires when the mouse moves over HTML formatted text, such as the example below although the mouse is still within the confines of the document:
<B>This is text</B>
Expected Behavior: The document_onmouseout event should only fire when the
mouse leaves the document.
The onmouseover and onmouseout events fire based on the element that the mouse is over. When we go from the body (plain text) to a bold (or anything else), then we "leave" being over the document and are now over the bold object. For this reason, the onmouseout event fires for the <BODY> tag.
This behavior is by design.
<HTML>
<HEAD>
<SCRIPT LANGUAGE=VBSCRIPT>
Sub document_onmouseout
Dim FromControl
Dim ToControl
FromControl = "From:" + window.event.fromElement.id + " "
ToControl = " To:" + window.event.toElement.id
MsgBox(FromControl + ToControl)
End Sub
</SCRIPT>
</HEAD>
<BODY id=theBody>
REGULAR TEXT<BR>
<B ID=Bold>BOLD TEXT</B>
</BODY>
</HTML>
For more information, please see the MSDN Web Workshop:
http://msdn.microsoft.com/workshop/default.asp
Additional query words:
Keywords : kbIE400 kbIE401 kbDSupport
Version : WINDOWS:4.0,4.01,5.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: July 22, 1999