MattoThePotatto
Programmer
Hey, I made a script for the page to adjust for different resolutions.. Works fine.. until I declair a DOCTYPE..
Here's the script..
var w = window.screen.width;
if(w >= 1280)
{
document.write('<link rel="stylesheet" type="text/css" href="css/layout1280.css" media="screen" />');
document.write('<link rel="stylesheet" type="text/css" href="css/playout1280.css" media="print" />');
}
if(w >= 1024 && w < 1280)
{
document.write('<link rel="stylesheet" type="text/css" href="css/layout1024.css" media="screen" />');
document.write('<link rel="stylesheet" type="text/css" href="css/playout1024.css" media="print" />');
}
if(w >= 800 && w < 1024)
{
document.write('<link rel="stylesheet" type="text/css" href="css/layout800.css" media="screen" />');
document.write('<link rel="stylesheet" type="text/css" href="css/playout800.css" media="print" />');
}
Which DOCTYPE can I use, or what can I do to the script to stop this problem?
Thanks, ^^
Here's the script..
var w = window.screen.width;
if(w >= 1280)
{
document.write('<link rel="stylesheet" type="text/css" href="css/layout1280.css" media="screen" />');
document.write('<link rel="stylesheet" type="text/css" href="css/playout1280.css" media="print" />');
}
if(w >= 1024 && w < 1280)
{
document.write('<link rel="stylesheet" type="text/css" href="css/layout1024.css" media="screen" />');
document.write('<link rel="stylesheet" type="text/css" href="css/playout1024.css" media="print" />');
}
if(w >= 800 && w < 1024)
{
document.write('<link rel="stylesheet" type="text/css" href="css/layout800.css" media="screen" />');
document.write('<link rel="stylesheet" type="text/css" href="css/playout800.css" media="print" />');
}
Which DOCTYPE can I use, or what can I do to the script to stop this problem?
Thanks, ^^