当前位置:开发者网络 >> 网页特效 >> 页面特效 >> 内容
精彩推荐
分类最新特效
分类热点特效
  
标题栏上显示鼠标座标
日期:2005-06-10   人气:   【字体: 】【收藏此文


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 1 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<script language="javascript">
var where = "";
function checkwhere(e) {
if (document.layers){
xCoord = e.x;
yCoord = e.y;
}
else if (document.all){
xCoord = event.clientX;
yCoord = event.clientY;
}
else if (document.getElementById){
xCoord = e.clientX;
yCoord = e.clientY;
}
document.title = "X座标值= "+ xCoord + " Y座标值= " + yCoord ;
}
document.onmousemove = checkwhere;
if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}
</script>