当前位置: 首页 > 图文教程 > 网络编程 > Javascript > JavaScript入门教程(5):Screen屏幕对象

Javascript
Javascript初学者实例教程(5):Document对象
JS初学者实例教程(6):Document对象读取表单元素
JS初学者实例教程(7):注册表单验证
JS初学者实例教程(8):单选按钮、复选按钮
JS初学者实例教程(9):下拉菜单和链接属性
Javascript初学者实例教程(11):鼠标动作
Javascript初学者实例教程(12):访问XML节点
JavaScript类
网页内应用JS的最好方法
JS两种定义Function非常常用的方法
网页JavaScript运行时IE产生警告栏解决方法
处理大量JavaScript对象的好选择:JSON
JSON(JavaScript Object Notation)
javascript用法:break,continue和return语句
JS获取各种浏览器窗口的大小
JavaScript发展与互联网
IE地址栏实现的JS有趣效果和应用
Javascript如何应用到网页中
Javascript条件判断语句的小技巧
Firebug Lite使用在IE、Opera、Safari浏览器

Javascript 中的 JavaScript入门教程(5):Screen屏幕对象


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 177 ::
收藏到网摘: n/a

这是基本JavaScript的屏幕对象


  • screen 屏幕对象 反映了当前用户的屏幕设置。
  • width 返回屏幕的宽度(像素数)。
  • height 返回屏幕的高度。
  • availWidth 返回屏幕的可用宽度(除去了一些不自动隐藏的类似任务栏的东西所占用的宽度)。
  • availHeight 返回屏幕的可用高度。
  • colorDepth 返回当前颜色设置所用的位数 - 1:黑白;8:256色;16:增强色;24/32:真彩色


下面是英文的Navigator浏览器的屏幕对象:

  • availHeight:minus permanent or semipermanent user interface features displayed by the operating system:such as the Taskbar on Windows.  
  • availWidth:Specifies the width of the screen, in pixels, minus permanent or semipermanent user interface:features displayed by the operating system, such as the Taskbar on Windows.  
  • colorDepth:The bit depth of the color palette, if one is in use; otherwise, the value is derived from screen.pixelDepth.  
  • height:Display screen height.  
  • pixelDepth:Display screen color resolution (bits per pixel).  
  • width:Display screen width.