Window-Screen对象

来源:互联网 发布:linux下不保存退出 编辑:程序博客网 时间:2024/05/26 20:22

Screen 对象

含有关客户端显示屏幕的信息

注意: 没有应用于 screen 对象的公开标准,不过所有浏览器都支持该对象。

Screen 对象属性

1. availHeight

声明了显示浏览器的屏幕的可用高度,以像素计。在 Windows 这样的操作系统中,这个可用高度不包括分配给半永久特性(如屏幕底部的任务栏)的垂直空间

google IE firefox safari opera true true true true true

screen.availHeight

document.write("可用高度: " + screen.availHeight);

2. availWidth

声明了显示浏览器的屏幕的可用宽度,以像素计。在 Windows 这样的操作系统中,这个可用宽度不包括分配给半永久特性(如屏幕右部的任务栏)的水平空间

google IE firefox safari opera true true true true true

screen.availWidth

document.write("可用宽度: " + screen.availWidth);

3. colorDepth

返回目标设备或缓冲器上的调色板的比特深度

google IE firefox safari opera true true true true true

screen.colorDepth

document.write("颜色深度: " + screen.colorDepth);

4. height

显示浏览器的屏幕的高度,以像素计。

google IE firefox safari opera true 10.0 true true true

screen.height

document.write("总高度: " + screen.height);

5. width

显示浏览器的屏幕的宽度,以像素计

google IE firefox safari opera true true true true true

screen.width

document.write("总宽度: " + screen.width);
文档内容出自 W3cSchool和菜鸟教程, 如需查看更详细的有关内容 请登录 http://www.w3school.com.cn/ 和 http://www.runoob.com/
原创粉丝点击