Forum Moderators: open
I needed help and this seemed like a helpful forum so here I am..
So here's the problem:
if(screen.width<1280) {
document.write('<link title="smallresfirefox" href="smallresfirefox.css" rel="stylesheet" type="text/css" />')
document.write('<!--[if IE]><link rel="stylesheet" type="text/css" href="smallresie.css" media="screen" /><![endif]-->');
}
else
document.write('<link title="firefox" href="firefox.css" rel="stylesheet" type="text/css" />')
document.write('<!--[if IE]><link rel="stylesheet" type="text/css" href="ie.css" media="screen" /><![endif]-->'); As you can see im trying to make it work so that a different CSS sheet is loaded @ different resolutions and with firefox and ie..
It works perfectly well except for 1 thing, namely when I open the page in IE in small resolution it somehow uses the 'ie.css' file instead of the 'smallresie.css' file, but when i remove the ie.css file from the folder it succesfully uses the smallresie.css file.. Why is this? And how can I fix this?
I posted this in Javascript because I'm guessing it's a javascript error, and I'm not good at JS
else
{
document.write('<link title="firefox" href="firefox.css" rel="stylesheet" type="text/css" />')
document.write('<!--[if IE]><link rel="stylesheet" type="text/css" href="ie.css" media="screen" /><![endif]-->');
}
See if that fixes the problem.
And welcome to WebmasterWorld! :)