Hi guys,
as per title im having a small problem hope theres a simple solution.
Basically im using the following code within my index page of my site to detect the resolution of the screen and redirect to a css file. It works perfectly in Firefox but i cant get it to work in Internet Explorer.
var winW = 0, winH = 0;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth-16;
winH = window.innerHeight-16;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
if (winW <= 1680) {
document.write('<link rel="stylesheet" type="text/css" href="style1680.css">');
}
if (winW <= 1600) {
document.write('<link rel="stylesheet" type="text/css" href="style.css">');
}
if (winW <= 1280) {
document.write('<link rel="stylesheet" type="text/css" href="style.css">');
}
if (winW <= 1024) {
document.write('<link rel="stylesheet" type="text/css" href="style1024.css">');
}
if (winW <= 800) {
document.write('<link rel="stylesheet" type="text/css" href="style800.css">');
}
if (winW <= 640) {
document.write('<link rel="stylesheet" type="text/css" href="style800.css">');
}
can any1 see why this wouldnt work in Internet explorer? on following site :
http://firefly.rar.gi
as per title im having a small problem hope theres a simple solution.
Basically im using the following code within my index page of my site to detect the resolution of the screen and redirect to a css file. It works perfectly in Firefox but i cant get it to work in Internet Explorer.
var winW = 0, winH = 0;
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth-16;
winH = window.innerHeight-16;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
if (winW <= 1680) {
document.write('<link rel="stylesheet" type="text/css" href="style1680.css">');
}
if (winW <= 1600) {
document.write('<link rel="stylesheet" type="text/css" href="style.css">');
}
if (winW <= 1280) {
document.write('<link rel="stylesheet" type="text/css" href="style.css">');
}
if (winW <= 1024) {
document.write('<link rel="stylesheet" type="text/css" href="style1024.css">');
}
if (winW <= 800) {
document.write('<link rel="stylesheet" type="text/css" href="style800.css">');
}
if (winW <= 640) {
document.write('<link rel="stylesheet" type="text/css" href="style800.css">');
}
can any1 see why this wouldnt work in Internet explorer? on following site :
http://firefly.rar.gi