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 |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | ? | (Yes) | (Yes) |
Feature | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | ? | ? | ? | (Yes) | ? |
© 2005–2018 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