只读属性,声明了窗口的文档显示区的高度和宽度,以像素计。
这里的宽度和高度不包括菜单栏、工具栏以及滚动条等的高度。
IE 不支持这些属性。它用 document.documentElement 或 ducument.body (与 IE 的版本相关)的 clientWidth 和 clientHeight 属性作为替代。
<script>
function getEvent(evnt){
eventWin = open('','','width=200,height=100');
with(eventWin.document){
write("事件类型:",event.type);
write("鼠标的x坐标",event.screenX);
write("鼠标的y坐标",event.screenY);
}
}
document.write("单击...")
document.onmousedown = getEvent;
</script>
<script>
function getCoordinate(evnt){
if(document.all){
x = event.screenX;
y = event.screenY;
}else{
x = evnt.screenX;
y = evnt.screenY;
}
status="水平坐标"+ x +";垂直坐标"+ y;
}
document.onmousemove = getCoordinate;
</script>
<script language="javascript">
function getEvent(evnt){
eventWin=open("","",'width=200,height=100');
with(eventWin.document){
//IE浏览器;
if(document.all){
write("事件类型:"+event.type);
write("鼠标的x坐标:"+event.screenX);
//网景浏览器;
}else{
write("事件类型:"+evnt.type);
write("鼠标的x坐标:"+evnt.screenX);
}
}
}
document.οnmοusedοwn=getEvent;
</script>
availHeight | 返回显示屏幕的高度 (除 Windows 任务栏之外)。 | 4 | 1 | 9 |
availWidth | 返回显示屏幕的宽度 (除 Windows 任务栏之外)。 | 4 | 1 | 9 |
珍藏多年的搜黄抠妹版软件-男人必备,今天拿出来分享要的速度: