Jump to content

Get users desktop size


Eyes

Recommended Posts

 

Impressive forum you got here.

 

I tried to search but did not find the answer, so I gonna post here:

 

How can I get information on the desktop size on the browser of the user connecting to the site?

 

The size of the actual browser window will also do.

 

Feedback like 600*480, 800*600, 1280*1024 is intended to run 2 different css in order to both show a nice layout for the modern pc, and a slim but working version for some old hardware.

 

??? ??? ???

 

Link to comment
https://forums.phpfreaks.com/topic/90905-get-users-desktop-size/
Share on other sites

 

try this:

 

<script language="javascript">
var wide = screen.width;
var heigh = screen.height;
if (wide == "800" && heigh == "600")
{
document.write("<link rel='stylesheet' type='text/css' media='screen' href='800X600' />");
}
else if (wide == "1024" && heigh == "768") {
document.write("<link rel='stylesheet' type='text/css' media='screen' href='1024X768' />");
}
else {
// add alternate stylesheet for other screen resolutions
}
</script>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.