Introduction to JS
Introduction Of Javascript
We can use this screen object property of Javascript to get the information regarding the screen width, height, colorDepth etc.
We also know that our window is the global object so we can write it or skip it because it is by default the global object.
Let's understand the examples below where we get the width of the screen.
screen.width:1280
screen.height:720
screen.colorDepth:24
Some properties and methods are described below :-
Methods/Property | Description |
---|---|
width | returns the width of the screen |
height | returns the height of the screen |
availWidth | returns the available width |
availHeight | returns the available height |
colorDepth | returns the color depth |
pixelDepth | returns the pixel depth. |
JS training insitute | Best IT Training classes in Gurgaon | Web Designing Training Institute