...

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



Resis
08-01-2002, 09: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">')
}
</script>

Any ideas where i'm going wrong?

cheers

Resis

boywonder
08-02-2002, 12:43 AM
<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