📄 8-4.htm
字号:
<html>
<head>
<title>§8.4 在网页上显示鼠标坐标</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" onMousemove="iemove();">
<script language="JavaScript">
if (navigator.appName == 'Netscape')
{
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = nsmove;
}
function nsmove(e)
{
if (e.screenX != document.xy.x.value && e.screenY != document.xy.y.value)
{
document.xy.x.value = e.screenX;
document.xy.y.value = e.screenY;
}
}
function iemove()
{
if (window.event.x != document.xy.x.value && window.event.y != document.xy.y.value)
{
document.xy.x.value = window.event.x;
document.xy.y.value = window.event.y;
}
}
</script>
<form NAME="xy">
X坐标: <INPUT TYPE="TEXT" NAME="x" SIZE="4"> Y坐标: <INPUT
TYPUE="TEXT" NAME="y" SIZE="4">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -