複製鏈接
請複製以下鏈接發送給好友

screenx

(計算機術語)

鎖定
在W3標註中,screenX 事件屬性可返回事件發生時鼠標指針相對於屏幕的水平座標
中文名
screenx
含    義
可返回事件發生
語    法
event.screenX
代碼示例
<html><head>

screenx術語解釋

在W3標註中,screenX 事件屬性可返回事件發生時鼠標指針相對於屏幕的水平座標。 [1] 

screenx語法

event.screenX

screenx代碼示例

<html>
<head>
<script type="text/javascript">
function show_coords(event) {
x=event.screenX
y=event.screenY
alert("X coords: " + x + ", Y coords: " + y)
}
</script>
</head>
<body onmousedown="show_coords(event)">
<p>Click in the document. An alert box will alert the x and y coordinates of the cursor.</p>
</body>
</html>
參考資料