Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
Sets or retrieves the y-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element.
Remarks
When the user moves the mouse over an object, one onmouseover event occurs, followed by one or more onmousemove events as the user moves the mouse pointer within the object. One onmouseout event occurs when the user moves the mouse pointer out of the object.
Examples
This example uses the onmouseout event to apply a new style to an object.
<BODY>
<P onmouseout="this.style.color='black';"
onmouseover="this.style.color='red';">
Move the mouse pointer over this text, and then move it elsewhere
in the document. Move the mouse pointer over this text, and then
move it elsewhere in the document.
</BODY>
This example shows how to swap images on mouse events.
<SCRIPT>
function flipImage(url)
{
if (window.event.srcElement.tagName == "IMG" )
{
window.event.srcElement.src = url;
}
}
</SCRIPT>
</HEAD>
<BODY>
<P>Move the mouse over the image to see it switch.<P>
<IMG SRC="/workshop/graphics/prop_ro.gif"
onmouseover="flipImage('/workshop/graphics/prop_rw.gif');"
onmouseout="flipImage('/workshop/graphics/prop_ro.gif');"
</BODY>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.