Java Reference
In-Depth Information
Screen Information
The
window.screen
object contains information about the screen that the browser is dis-
played on. You can find out the height and width of the screen in pixels using the
height
and
width
properties respectively:
window.screen.height;
<< 1024
window.screen.width;
<< 1280
The
availHeight
and
availWidth
can be used to find the height and width of the
screen, excluding any operating system menus:
window.screen.availWidth;
<< 1280
window.screen.availHeight;
<< 995
The
colorDepth
property can be used to find the color bit depth of the user's monitor,
although there are few use cases for doing this other than collecting user statistics:
window.screen.colorDepth;
<< 24
