The Screen Object
The screen object is used as an indication of client capabilities.
The following table list all properties from screen object supported by all major browsers.
Name | Description | Returns |
---|---|---|
availHeight | The pixel height of the screen minus system elements such as toolbar (read only) | number |
availWidth | The pixel width of the screen minus system elements such as toolbar(read only) | number |
colorDepth | The number of bits used to represent colors; for most systems, 32 (read only) | number |
height | Returns the pixel height of the screen. | number |
width | Returns the pixel width of the screen. | number |
To resize the browser to take up the available space in the screen:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
window.resizeTo(screen.availWidth, screen.availHeight);
</script>
</head>
<body>
</body>
</html>