mouseMove Events





The mouseMove event is used exclusively with the Event object. It is used to track the location of the pointer on the screen within the current page. This script and accompanying HTML track the movement of the mouse on the document.
<HEAD>
<TITLE>Mouse Movements </TITLE>
</HEAD>
<SCRIPT LANGUAGE="javascript">
docu ment.captu reEv ents (Event. MOUSEMOVE);
function HandleEvent(e){
message = "Event= A$ + e.type + ".";// event type
message += "x, y pos.= " + e.layerX + "," + e.layerY // click position
document.displayForm.coordinates.value = message; display info
return true;
}
document.onmousemove = HandleEvent;
</SCRIPT>
<BODY>
<Hl>This is a page</Hl>
<P>H! there</P>
<H1 >This is a page</Hl>
<P>Hi there</P>
<FORM NAME="displayForm">
<INPUT NAME="coordinates" TYPE=text size=45>
</FORM>
</BODY>
</HTML>
Domain Name Search
|