Home > Article > Web Front-end > JavaScript introductory tutorial (5) js Screen screen object_basic knowledge
screen screen object reflects the current user's screen settings.
width returns the width of the screen in pixels.
height returns the height of the screen.
availWidth returns the available width of the screen (excluding the width occupied by some things like the taskbar that do not automatically hide).
availHeight returns the available height of the screen.
colorDepth returns the number of bits used in the current color setting - 1: black and white; 8: 256 colors; 16: enhanced color; 24/32: true color
The following is the screen object of the English Navigator browser:
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.