Karina
02-08-2007, 11:41 PM
I'd be greatful to anyone who can help me correct the code for resolution detection for internet explorer6. Most of the following formats work for almost all browsers except IE6 . I'd appreciate any code that yu already have that is working.
Thanks everbody.
This format didnt work for IE6
<SCRIPT LANGUAGE="JavaScript1.2">
if (screen.height >= 600 && screen.width >= 800) {
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/reduced-ie6.css" type="text/css">");
}
else {
if (screen.height == 768 && screen.width == 1024) {
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6.css" type="text/css">");
}
else {
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6" type="text/css">");
}
}
</script>
This code didnt make it either
<script language="JavaScript" type="text/javascript">
if(screen.width<=800)
{document.write("<link rel=\"stylesheet\" href=\"http://www.mysite.com/Css-folder/reduced-ie6.css\" type=\"text/css\"/>");}
else
if(screen.width<=1024)
{document.write("<link rel=\"stylesheet\" href=\"http://www.mysite.com/Css-folder/expanded-ie6.css\" type=\"text/css\"/>");}
else
{document.write("<link rel=\"stylesheet\" href=\"http://www.mysite.com/Css-folder/expanded-ie6.css\" type=\"text/css\"/>");}
</script
This code also failed
<script language="JavaScript" type="text/javascript">
if(screen.width<=800)
{document.write("<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/reduced-ie6.css);@import url(http://www.mysite.com/Css-folder/reduced-ie6.css);<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/reduced-fifo.css);@import url(http://www.mysite.com/Css-folder/reduced-fifo.css)</style>");}
else
if(screen.width<=1024)
{document.write("<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-fifo.css);@import url(http://www.mysite.com/Css-folder/reduced-fifo.css)</style>");}
else
{document.write("<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-fifo.css);@import url(http://www.mysite.com/Css-folder/reduced-fifo.css)</style>");}
</script>
This code worked partially(outcome was a deshaped look)
function setStyleSheet()
{ width = getTheWidthThatMatters();
height = getTheHeightThatMatters();
if(width<800 && height<600)
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/reduced-ie6.css" type="text/css">");
return;
}
else
if(width<1024 && height<768)
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6.css" type="text/css">");
return;
else
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6.css" type="text/css">");
return;
}
setStyleSheet();
Thanks everbody.
This format didnt work for IE6
<SCRIPT LANGUAGE="JavaScript1.2">
if (screen.height >= 600 && screen.width >= 800) {
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/reduced-ie6.css" type="text/css">");
}
else {
if (screen.height == 768 && screen.width == 1024) {
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6.css" type="text/css">");
}
else {
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6" type="text/css">");
}
}
</script>
This code didnt make it either
<script language="JavaScript" type="text/javascript">
if(screen.width<=800)
{document.write("<link rel=\"stylesheet\" href=\"http://www.mysite.com/Css-folder/reduced-ie6.css\" type=\"text/css\"/>");}
else
if(screen.width<=1024)
{document.write("<link rel=\"stylesheet\" href=\"http://www.mysite.com/Css-folder/expanded-ie6.css\" type=\"text/css\"/>");}
else
{document.write("<link rel=\"stylesheet\" href=\"http://www.mysite.com/Css-folder/expanded-ie6.css\" type=\"text/css\"/>");}
</script
This code also failed
<script language="JavaScript" type="text/javascript">
if(screen.width<=800)
{document.write("<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/reduced-ie6.css);@import url(http://www.mysite.com/Css-folder/reduced-ie6.css);<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/reduced-fifo.css);@import url(http://www.mysite.com/Css-folder/reduced-fifo.css)</style>");}
else
if(screen.width<=1024)
{document.write("<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-fifo.css);@import url(http://www.mysite.com/Css-folder/reduced-fifo.css)</style>");}
else
{document.write("<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);@import url(http://www.mysite.com/Css-folder/expanded-ie6.css);<style type="text/css" media="all">@import url(http://www.mysite.com/Css-folder/expanded-fifo.css);@import url(http://www.mysite.com/Css-folder/reduced-fifo.css)</style>");}
</script>
This code worked partially(outcome was a deshaped look)
function setStyleSheet()
{ width = getTheWidthThatMatters();
height = getTheHeightThatMatters();
if(width<800 && height<600)
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/reduced-ie6.css" type="text/css">");
return;
}
else
if(width<1024 && height<768)
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6.css" type="text/css">");
return;
else
document.write("<link rel="stylesheet" href="http://www.mysite.com/Css-folder/expanded-ie6.css" type="text/css">");
return;
}
setStyleSheet();