View Full Version : Finding out viewers Screen Resolution

06-08-2004, 04:13 PM
Hi All...

Is there anyway to detect what screen resolution a viewer is using. I would like to be able to detect this and if they are using a smaller resolution than what the site is best viewed with, suggest them to change.

Ideally I would like to give them the option of changing their resolution eg. "This site is best viewed with a 1024x768 resolution! Would you like to change it?" and if they clicked OK for it to auto change (I know the alert would require JS) - but this I suppose is wishful thinking! LOL

Thanks :thumbsup:


06-08-2004, 04:20 PM
You definitely can't do it with PHP, as it is server side not client side, so has nothing to do with the client. You might be able to do it with Javascript, but I know very little JS so can't help you there :p

06-08-2004, 04:22 PM
Just looked it up that you can find it out using screen.height and screen.width in JS. Here is link:


06-08-2004, 04:38 PM
Thanks - that helped - I have simply put a "if resolution < 1024x768 to alert them and show them instructions on how to change it to the desired resolution"...

And yep - its all javascript - so waiting to be moved to that forum! LOL

06-08-2004, 04:42 PM
Glad to b of help :p ... and yeh im awaiting the move as well lol