What is screen object in JavaScript?

Screen object helps in getting the information of the user's screen. We can get the width, height, colorDepth etc. of the user's screen. This information will be helpful in setting the size of the images, page to be displayed in the Browser. Anyone can give an example for satisfaction.


3 Answers
1-3 of  3
3 Answers
  • It provides information about when we visited the web page.For ex,
    1.screen.availHeight-It represent the height of the web-page
    2.screen.height-It represent the total height of page
    3-screen.availwidth-It represent the width(base) of page
    4.screen.width-It represent the total width of page and so on
    5.scree.colordepth-Color palettes of the page

  • Screen Object
    The screen object contains information about the visitor's screen.

    Note: There is no public standard that applies to the screen object, but all major browsers support it.

    Screen Object Properties
    Property                                                      Description

    availHeight                        Returns the height of the screen (excluding the Windows Taskbar)

    availWidth                          Returns the width of the screen (excluding the Windows Taskbar)

    colorDepth                          Returns the bit depth of the color palette for displaying images

    height                                  Returns the total height of the screen

    pixelDepth                            Returns the color resolution (in bits per pixel) of the screen

    width Returns the total width of the screen

Javascript

Didn't get the answer.
Contact people of Talent-Javascript directly by clicking here