View Full Version : Screen Resolution script not working!!!

08-01-2002, 08:30 PM
Hello everybody,

I'm trying to write a simple script that will enable me to use a perticular style sheet depending on the uses screen resolution,
here's my current effort (doesn't work):

<script language="JavaScript 1.2">
var eight_width=800
var six_height=600
var one_width=1024
var seven_height=768
if (screen.width<=eight_width||screen.height<=six_height)
document.write('<link rel ="stylesheet" href="styles800.css" type="text/css">')
else if (screen.width>=one_width&&screen.height>=seven_height)
document.write('<link rel ="stylesheet" href="styles1024.css" type="text/css">')

Any ideas where i'm going wrong?



08-01-2002, 11:43 PM
<script language="JavaScript 1.2">

lose the space in that line.

<script language="JavaScript1.2">

hope that helps

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum