?? dom2 mouse events.htm
字號:
?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>DOM2 Mouse Events</title>
<meta http-equiv="content--type" content="text/html charset=gb2312;" />
</head>
<body>
<h2>
DOM2 鼠標(biāo)事件</h2>
<form id="mouseform" name="mouseform" action="#" method="get">
Alt Key down?<input id="altkey" type="text" /><br />
Control Key Down?<input id="controlkey" type="text" /><br />
Meta key Down?<input id="metakey" type="text" /><br />
shift key Down?<input id="shiftkey" type="text" /><br />
在瀏覽器中的按鍵位置:<input id="clientx" type="text" />,<input id="clienty" type="text" /><br />
在屏幕上的位置:<input id="screenx" type="text" />,<input id="screeny" type="text" /><br />
使用的按鍵:<input id="buttonused" type="text" /><br />
<br>
</form>
<hr />
在文檔中的任意位置按下鼠標(biāo)鍵...
<script type="text/javascript">
<!--
function showMouseDetails(event)
{
var theForm=document.mouseform;
theForm.altKey.value=event.altKey;
theForm.controlkey.value=event.ctrKey;
theForm.shiftkey.value=event.shiftKey;
theForm.metakey.value=event.metaKey;
theForm.clientx.value=event.clientX;
theForm.clienty.value=event.clientY;
theForm.screenx.value=event.screenX;
theForm.screeny.value=event.screenY;
if(event.button==0)
{
theForm.buttonused.value="left";
}
else if(event.button==1)
{
theForm.buttonused.value="middle";
}
else
theForm.buttonused.value="right";
}
document.addEventListener("click",showMouseDetails,true);
//-->
</script>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -