How to get screen resolution of visitor in javascript and/or php?
javascript, jquery, php
Solution
What makes you think people always have their browser window maximised to the same size as their screen? I don't, and I'm not the only one.
What you want is to cover 75% of their window. This can be done using CSS; if the element in question is a child of the body element, then
#box {
position: absolute;
top: 12.5%;
left: 12.5%;
width: 75%;
height: 75%;
}
will probably do it (I've not tested it, though).
EDIT: I've now tested it, adding
html, body {
width: 100%;
height: 100%;
}
and it worked as expected, at least in Firefox 3.5 :-)
Problem
I would like to know the screen resolution of a visitor visiting my page so I can properly make a jquery thickbox cover about 75% of their screen. Solutions to the question or helping me solve my problem are greatly appreciated!