How to get screen resolution of a client system by using JavaScript
I am developing a website,my webpage consist of many products. on clicking over a product i must show the details of that product in popup window.For setting the p开发者_如何转开发opup window to full window, i want to get client system resolution, so that it may easy to show the popup window in full screen according to resolution. Can any one please help me to sort a way to solve this problem by using JavaScript or any other method.
Thanks in advance...
To get the client's window dimensions with Javascript:
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
The Javascript variables screen.width
and screen.height
work well enough in most browsers.
You will however have to subtract a few pixels off the height for the title bar and what not.
精彩评论