Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determine Client Screen Resolution

Status
Not open for further replies.

vionca

MIS
Nov 19, 2003
60
US
Hi,

Does anyone here know how to determine the client's screen resolution so that I may format my code accordingly?

In my particular situation, I will not be able to apply a fixed width or percentage to the table without sacrificing the table appearance.

Any have any ideas?

Thanks,
Vionca
 
1
<script>
if ((screen.width < 1024) && (screen.height < 768)) {
agree = confirm(&quot;Because your screen resolutions is set to &quot;+screen.width+&quot;x&quot;+screen.height+&quot;. This page may not display as intended. Press OK if you wish to continue...&quot;);
if (!agree) history.go(-1);
}
//-->
</script>







2
<script language=&quot;JavaScript&quot;>
var s800x600page = &quot;index1.htm&quot;;
var s1024x768page = &quot;index2.htm&quot;;
var s1152x864page = &quot;index3.htm&quot;;
var pagetype;
if ((screen.height == 600) && (screen.width == 800)) {
pagetype = 1; }
else if ((screen.height == 768) && (screen.width == 1024)) {
pagetype = 2; }
else if ((screen.height == 864) && (screen.width == 1152)) {
pagetype = 3; }
else {
pagetype = 3; }
if (pagetype == 1) { window.location.href = s800x600page }
else if (pagetype == 2) { window.location.href = s1024x768page }
else if (pagetype == 3) { window.location.href = s1152x864page }
//-->
</script>



logo.gif width='75' height='15'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top