javascript取得鼠标的位置
生活随笔
收集整理的這篇文章主要介紹了
javascript取得鼠标的位置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JavaScript得到鼠標坐標</title>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<meta?name="Generator"?content="EditPlus"?/>
<meta?name="Author"?content="Dicky">
<meta?name="Keywords"?content="ENSONFLY'S?BLOG:http://ensonfly.guwancun.com/">
<script?language="javascript"?type="text/javascript">
<!--
function?document.onmousemove()
{
x.innerHTML?=?"相對位置:X:"?+?window.event.x?+?"?Y:"?+?window.event.y;
y.innerHTML?=?"絕對位置:X:"?+?window.event.screenX?+?"?Y:"?+?window.event.screenY;
}
//-->
</script>
</head>
<body>
<div?id="x"></div>
<div?id="y"></div>
</body>
</html>
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JavaScript得到鼠標坐標</title>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<meta?name="Generator"?content="EditPlus"?/>
<meta?name="Author"?content="Dicky">
<meta?name="Keywords"?content="ENSONFLY'S?BLOG:http://ensonfly.guwancun.com/">
<script?language="javascript"?type="text/javascript">
<!--
function?document.onmousemove()
{
x.innerHTML?=?"相對位置:X:"?+?window.event.x?+?"?Y:"?+?window.event.y;
y.innerHTML?=?"絕對位置:X:"?+?window.event.screenX?+?"?Y:"?+?window.event.screenY;
}
//-->
</script>
</head>
<body>
<div?id="x"></div>
<div?id="y"></div>
</body>
</html>
轉載于:https://www.cnblogs.com/suzongwei/archive/2008/03/27/1125357.html
總結
以上是生活随笔為你收集整理的javascript取得鼠标的位置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: .net导出到Excel与Word中(带
- 下一篇: MSSQL 2008里事务的一个问题