39对象9---screen

来源:互联网 发布:秒拍软件 编辑:程序博客网 时间:2024/06/07 19:29

screen对象
screen对象用于获取用户的屏幕信息。

语法:

window.screen.属性

对象属性:
这里写图片描述


<!DOCTYPE html><html><body><h3>Your Screen:</h3><script>document.write("窗口可以使用的屏幕宽高: ");document.write(window.screen.availWidth + "*" + screen.availHeight);document.write("<br>");document.write("屏幕的宽高: ");document.write(screen.availWidth + "*" + window.screen.height);document.write("<br>");document.write("用户浏览器表示的颜色位数: ");document.write(window.screen.colorDepth);document.write("<br>");document.write("用户浏览器表示的颜色位数(ps:IE不支持?亲测好像支持唉): ");document.write(screen.pixelDepth);</script><body></body></html>
原创粉丝点击