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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross Browser compatability?? Screen resoloution

Status
Not open for further replies.

caffreygirl

Technical User
Jan 28, 2003
16
GB
Hi-ya,
One coment that has been made about the site I've just completed is that it isn't cross browser compatable and dosen't alter acording to accomadate screen resoloution. Can anyone point me in the right direction regarding this matter..... Many thanks :)

The site:
 
[tt]Two ways of doing this

1. You would first check the user's resolution and re-direct accordingly

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


AND

2. You let the user know that due to their resolution, the page may not display as intended.


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


T ® Ñ ¥
To keep a lamp burning we have to keep puting oil in it.
Progress2.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top