mozilla
Your Search Results

    window.screen Redirect 1

    « window

    Summary

    Returns a reference to the screen object associated with the window.

    The screen object is a special object for inspecting properties of the screen on which the current window is being rendered.

    Syntax

    screenObj = window.screen;
    

    Properties

    Screen.availTop
    Specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features.
    Screen.availLeft
    Returns the first available pixel available from the left side of the screen.
    Screen.availHeight
    Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.
    Screen.availWidth
    Returns the amount of horizontal space in pixels available to the window.
    Screen.colorDepth
    Returns the color depth of the screen.
    Screen.height
    Returns the height of the screen in pixels.
    Screen.left
    Returns the distance in pixels from the left side of the main screen to the left side of the current screen.
    Screen.orientation
    Returns the current orientation of the screen.
    Screen.pixelDepth
    Gets the bit depth of the screen.
    Screen.top
    Returns the distance in pixels from the top side of the current screen.
    Screen.width
    Returns the width of the screen.
    Screen.mozEnabled
    Boolean. Setting to false will turn off the device's screen.
    Screen.mozBrightness
    Controls the brightness of a device's screen. A double between 0 and 1.0 is expected.

    Events handler

    Screen.onorientationchange
    A handler for the orientationchange events.

    Methods

    Screen.lockOrientation
    Lock the screen orientation (only works in fullscreen or for installed apps)
    Screen.unlockOrientation
    Unlock the screen orientation (only works in fullscreen or for installed apps)

    Methods inherit from EventTarget

    EventTarget.addEventListener()
    Register an event handler of a specific event type on the EventTarget.
    EventTarget.removeEventListener()
    Removes an event listener from the EventTarget.
    EventTarget.dispatchEvent()
    Dispatch an event to this EventTarget.

    Example

    if (screen.pixelDepth < 8) {
      // use low-color version of page
    } else { 
      // use regular, colorful page
    }
    

    Specification

    TBD

    Document Tags and Contributors

    Contributors to this page: Sheppy
    Last updated by: Sheppy,
    Hide Sidebar