Detecting Screen Resolution



JSSometimes it's helpful to know what resolution your users are using when they access your site. You can get this information by utilizing the screen object.


The screen object contains a number of helpful properties, but the first and foremost among them is width and height. With these two properties you can detect the user's screen resolution.
The screen object also contains fields called availWidth and availHeight. What's the difference between these two sets of numbers? The availWidth and availHeight give you (in pixels) the amount of space usable by an application in a maximized state-this is often less than the user's full screen resolution. For example, on many Windows systems, even when an application is maximized, you typically lose some screen real estate due to operating specific features such as the taskbar.
Below are the screen resolution values your browser detects for your system:


No comments :