显示鼠标坐标:在方框中显示鼠标在页面的坐标_键盘鼠标特效

模板酷站
  •       4/5
  •       1
  •       2
  •       3
  •       4
  •       5
查看演示效果

      织梦DedeCMS视频教程买空间 租服务器 选网硕互联! 无忧站长工具,百度权重一键全查!

      显示鼠标坐标:在方框中显示鼠标在页面的坐标,您可以先修改部分代码再运行.

      第一步:把如下代码加入<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 onMousemove="micro$oftMouseMove()">