鼠标移动测试程序,只能显示左右移动,脚本测试后给出中文提示。
<html>
<head>
<title>鼠标移动测试-源码搜藏WEB开发www.codesocang.com</title>
<script language="JavaScript">
try { var old = event.x }
catch (e) { }
function test()
{
if (old == event.x)
{
document.all.ospan.innerText = "鼠标没动"
}
if (old > event.x)
{
document.all.ospan.innerText = "鼠标左移"
}
if (old < event.x)
{
document.all.ospan.innerText = "鼠标右移"
}
old = event.x
}
</script>
</head>
<body onmousemove="test()">
<span id="ospan"></span>
</body>
</html>
<a href="http://www.codesocang.com/texiao/index.html">欢迎访问源码搜藏网页特效集</a>
相关内容推荐