获取网页上的屏幕信息和鼠标坐标
2007-12-06 11:14
459 查看
<html>
<head>
<style type="text/css">
<!--
p { color: blue; font-size: 37px; font-family: impact }
-->
</style>
<title>Screen and Mouse position</title>
</head>
<script language="javascript">
function reportMove()
{
window.status = "X=" + window.event.x + " Y=" + window.event.y;
// window.status="X="+window.event.screenX+" Y="+window.event.screenY;
}
function reportScreen()
{
var s = "网页可见区域宽:"+ document.body.clientWidth;
s += "/r/n网页可见区域高:"+ document.body.clientHeight;
s += "/r/n网页正文全文宽:"+ document.body.scrollWidth;
s += "/r/n网页正文全文高:"+ document.body.scrollHeight;
s += "/r/n网页正文部分上:"+ window.screenTop;
s += "/r/n网页正文部分左:"+ window.screenLeft;
s += "/r/n屏幕分辨率的高:"+ window.screen.height;
s += "/r/n屏幕分辨率的宽:"+ window.screen.width;
s += "/r/n屏幕可用工作区高度:"+ window.screen.availHeight;
s += "/r/n屏幕可用工作区宽度:"+ window.screen.availWidth;
alert(s);
}
</script>
<body onmousemove="reportMove()" onmousedown="reportScreen()">
<p>
When you click you mouse,<br />Show you the Screen information</p>
</body>
</html>
<head>
<style type="text/css">
<!--
p { color: blue; font-size: 37px; font-family: impact }
-->
</style>
<title>Screen and Mouse position</title>
</head>
<script language="javascript">
function reportMove()
{
window.status = "X=" + window.event.x + " Y=" + window.event.y;
// window.status="X="+window.event.screenX+" Y="+window.event.screenY;
}
function reportScreen()
{
var s = "网页可见区域宽:"+ document.body.clientWidth;
s += "/r/n网页可见区域高:"+ document.body.clientHeight;
s += "/r/n网页正文全文宽:"+ document.body.scrollWidth;
s += "/r/n网页正文全文高:"+ document.body.scrollHeight;
s += "/r/n网页正文部分上:"+ window.screenTop;
s += "/r/n网页正文部分左:"+ window.screenLeft;
s += "/r/n屏幕分辨率的高:"+ window.screen.height;
s += "/r/n屏幕分辨率的宽:"+ window.screen.width;
s += "/r/n屏幕可用工作区高度:"+ window.screen.availHeight;
s += "/r/n屏幕可用工作区宽度:"+ window.screen.availWidth;
alert(s);
}
</script>
<body onmousemove="reportMove()" onmousedown="reportScreen()">
<p>
When you click you mouse,<br />Show you the Screen information</p>
</body>
</html>
相关文章推荐
- Unity如何获取鼠标当前帧和上一帧的屏幕坐标差
- 获取鼠标在屏幕上的坐标和颜色值(RGB)
- JavaScript基础 event 显示鼠标点击处的坐标值(For Firefox) 距离窗口的距离 距离网页的距离 距离屏幕的距离
- Unity中UGUI中获取鼠标点击位置以及UI物体的屏幕坐标
- 在PV3D中获取鼠标点击位置的空间坐标信息
- 获取cancvs上鼠标的坐标信息
- JS获取屏幕、浏览器、网页高度,宽度信息 定位div
- JS获取网页大小和鼠标当前坐标
- C#简单获取屏幕鼠标坐标点颜色
- JavaScript基础 event 显示鼠标点击处的坐标值(For Firefox) 距离窗口的距离 距离网页的距离 距离屏幕的距离
- JS网页在线获取鼠标坐标值的方法
- 获取屏幕宽度、浏览器宽度、网页高度,宽度信息
- VC 获取鼠标 点击时的屏幕坐标
- 鼠标移过显示提示信息框(自动获取鼠标坐标)
- js获取浏览器宽高、网页宽高、屏幕宽高、鼠标位置等(带图片说明)
- 获取屏幕分辨率及网页信息
- JavaScript基础 event(For IE) 显示鼠标点击处的坐标值 距离窗口的距离 距离网页的距离 距离屏幕的距离
- JavaScript特效一(网页换肤、鼠标移到头像上获取个人信息getByClass)
- JS获取屏幕、浏览器、网页高度,宽度信息 定位div
- javascrpt获取屏幕坐标等信息