Name
Screen — information about the display screen
Synopsis
The screen property of a
Window refers to a Screen object. The properties of this global
object contain information about the computer monitor on which the
browser is displayed. JavaScript programs can use this information
to optimize their output for the user’s display capabilities. For
example, a program can choose between large and small images based
on the display size.
Properties
readonly unsigned longavailHeightSpecifies the available height, in pixels, of the screen on which the web browser is displayed. This available height does not include vertical space allocated to permanent desktop features, such as a bar or dock at the bottom of the screen.
readonly unsigned longavailWidthSpecifies the available width, in pixels, of the screen on which the web browser is displayed. This available width does not include horizontal space allocated to permanent desktop features.
readonly unsigned longcolorDepthreadonly unsigned longpixelDepthThese synonymous properties both specify the color depth of the screen in bits per pixel.
readonly unsigned longheightSpecifies the total height, in pixels, of the screen on which the web browser is displayed. See also
availHeight.readonly unsigned longwidthSpecifies the total width, in pixels, of the screen on which the web browser is displayed. See also
availWidth.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access