| 显示鼠标坐标 |
| 作者:小雨 文章来源:本站原创 点击数: 更新时间:2005-7-15 17:08:00 |
|
|
脚本说明:第一步:把如下代码加入<body>区域中:
<SCRIPT LANGUAGE="JavaScript"> if (navigator.appName == 'Netscape') { document.captureEvents(Event.MOUSEMOVE); document.onmousemove = netscapeMouseMove; }
function netscapeMouseMove(e) { if (e.screenX != document.test.x.value && e.screenY != document.test.y.value) { document.test.x.value = e.screenX; document.test.y.value = e.screenY; } }
function micro$oftMouseMove() { if (window.event.x != document.test.x.value && window.event.y != document.test.y.value) { document.test.x.value = window.event.x; document.test.y.value = window.event.y; } } </SCRIPT> <FORM NAME="test"> X: <INPUT TYPE="TEXT" NAME="x" SIZE="4"> Y: <INPUT TYPUE="TEXT" NAME="y" SIZE="4"> </FORM>
第二步:把<body>中内容改为: <body bgcolor="#fef4d9" onMousemove="micro$oftMouseMove()">
|
|
| 文章录入:小雨 责任编辑:小雨 |
|
上一篇文章: 使链接变为粗体的效果 下一篇文章: 跟随鼠标的彩色字符 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |
|
|
|