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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.