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

Javascript
javascript 函数介绍
超酷的鼠标拖拽翻页(分页)效果实现javascript代码
关于Javascript中的事件--Event对象
js+css图片自动等比例缩小且垂直居中
输入法下keyup失效的解决方案
关于初次学习Ajax的一些心得
可以不被浏览器拦截的弹出窗口JS代码
网页设计常用的Javascript特效代码
XMLHTTPRequest的属性和方法
微软、Mozilla舌战新版JavaScript发展
网页制作中常用的几段小Javascript代码
Ajax是建立Web应用的一条新途径
AJAX学习:理解JavaScript函数
javascript下的正则表达式基本书写
学习 javascript 注意的4个问题
javascript正则表达式的常用方法总结
初学者全面接触学习jquery(译文)
用Ajax和Web2.0扩展SOA
使用 jQuery 简化 Ajax 开发
关于clientHeight、offsetHeight、scrollHeight

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


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