Home >Web Front-end >JS Tutorial >Screen screen object in JavaScript_Basic knowledge
This is the basic JavaScript screen object
screen The screen object reflects the current user's screen settings.
width Returns the width of the screen (number of 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 are not automatically hidden).
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.