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

Screen Resolutions

Status
Not open for further replies.

Billybonga

IS-IT--Management
Jun 22, 2002
72
GB
i'm designing a site that is designed for a resolution 1024*768
I have written this script to detect the user's resolution and if lower than 1024*768 it would advised the user that they are not running the recommended resolution

var correctwidth=1024
var correctheight=768
if (screen.width<correctwidth||screen.height<correctheight)
document.write(&quot;This webpage is bested viewed with screen resolution &quot;+correctwidth+&quot;*&quot;+correctheight+&quot; or above. Your current resolution is &quot;+screen.width+&quot;*&quot;+screen.height+&quot;. If possible, please change the resolution!&quot;)
else
document.write(&quot;If resolution is 1024*768 or above display this text.&quot; )


now this is running fine but what i was to do is add in a weblink in:
document.write(&quot;This webpage is bested viewed with screen resolution &quot;+correctwidth+&quot;*&quot;+correctheight+&quot; or above. Your current resolution is &quot;+screen.width+&quot;*&quot;+screen.height+&quot;. If possible, please change the resolution!&quot;)

So that if the screen is at lower resolution it will advise the user and would have a link to a page advising how to change the resolution.


Any ideas ?

Billybong
 
I don't wnat to put you off too much, but screen resolution alone will not controll the appearance of your page unless the visitor is using tha same browser. All browseres have slightly different display areas and what happens if the user cannot up resolution past 800x600 or they doent have there browser maximised. Your carefully designed page will be distorted. It's not a lie if you believe it!

 
i personally wouldn't change my screen resolution for any site.

:)

=========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top