JavaScript入門教程(5):Screen屏幕對象
編輯:關於JavaScript  
這是基本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.