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

Javascript
JQuery Tips(3) 关于$()包装集内元素的改变
JavaScript 创建随机数和随机图片
javascript document.execCommand() 常用解析
firefox下对ajax的onreadystatechange的支持情况分析
Javascript attachEvent传递参数的办法
jQuery Attributes(属性)的使用(一、属性篇)
jquery自动完成插件(autocomplete)应用之PHP版
查询绑定数据岛的表格中的文本并修改显示方式的js代码
讨论javascript(一)工厂方式 js面象对象的定义方法
IE不支持option的display样式,只能使用remove和add
多浏览器兼容的获取元素和鼠标的位置的js代码
js checkbox全选并将获取值放到input里边
javascript 日期联动选择器 [其中的一些代码值得学习]
javascript实现的仿51job地址多项选择方式效果
jQuery 渐变下拉菜单
利用图片的 onerror 事件载入默认图片
js实现页面打印功能实例代码(附去页眉页脚功能代码)
JQuery读取XML文件数据并显示的实现代码
比较详细的关于javascript 解析json的代码
TextArea 控件的最大长度问题(js json)

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 297 ::
收藏到网摘: 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.