Resis
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">')
}
</script>
Any ideas where i'm going wrong?
cheers
Resis
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