日期:2014-05-16 浏览次数:20364 次
<!DOCTYPE html>
<html>
<head>
<script>
function getPos(e){
x=e.clientX;
y=e.clientY;
cursor="Your Mouse Position Is : " + x + " and " + y ;
document.getElementById("displayArea").innerHTML=cursor
}
function stopTracking(){
document.getElementById("displayArea").innerHTML="";
}
function displayPos(e){
getPos(e);
}
</script>
</head>
<body>
<div id="focusArea" onclick="displayPos(event)"><p>Mouse Over This Text And Get The Cursor Position!</p></div>
<!--<div id="focusArea" onmousemove="getPos(event)" onmouseout="stopTracking()" onclick="displayPos(event)"><p>Mouse Over This Text And Get The Cursor Position!</p></div>-->
<p id="displayArea"></p>
</body>
</html>
<img src="http://img.bbs.csdn.net/upload/201401/02/1388643807_947015.jpg" border="0" usemap="#Map"/>
<map name="Map" id="Map">
<area shape="poly" coords="48,120,359,118,447,237,102,241,79,188" href="#" onmousemove="alert('按钮2')" />