The Screen
interface represents a screen, usually the one on which the current window is being rendered.
Usually it is the one on which the current window is being rendered, obtained using window.screen
.
Screen.availTop
Screen.availLeft
Screen.availHeight
Screen.availWidth
Screen.colorDepth
Screen.height
Screen.left
Screen.orientation
Screen.pixelDepth
Screen.top
Screen.width
Screen.mozEnabled
Screen.mozBrightness
Screen.onorientationchange
orientationchange
events.Screen.lockOrientation
Screen.unlockOrientation
Methods inherit from EventTarget
EventTarget.addEventListener()
EventTarget
.EventTarget.removeEventListener()
EventTarget
.EventTarget.dispatchEvent()
EventTarget
.Mozilla extensions for use by JS-implemented event targets to implement on* properties. See also WebIDL bindings.
if (screen.pixelDepth < 8) { // use low-color version of page } else { // use regular, colorful page }
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'Screen' in that specification. | Working Draft |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/screen