Computer >> Computer tutorials >  >> Programming >> Javascript

What are Screen objects in javascript?


The Window property 'screen' returns a reference to the screen object associated with the window.

The screen object, implementing the Screen interface, is a special object for inspecting properties of the screen on which the current window is being rendered. There are many properies available on this object that can be used to determine and set some properies of the client's screen. For example,

  • 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 ScreenOrientation instance associated with this 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.