function xx()
{
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
var IE1024="products1.css";
var IE800="products1.css";
var IE1152="products1.css";
var IEother="products.css";
ScreenWidth(IE1024,IE800,IE1152,IEother)
}else{
if (window.navigator.userAgent.indexOf("Firefox")>=1)
{
//如果浏览器为Firefox
var Firefox1024="products1.css";
var Firefox800="products1.css";
var Firefox1152="products1.css";
var Firefoxother="products.css";
ScreenWidth(Firefox1024,Firefox800,Firefox1152,Firefoxother)
}else{
//如果浏览器为其他
var Other1024="products1.css";
var Other800="products1.css";
var Other1152="products1.css";
var Otherother="products.css";
ScreenWidth(Other1024,Other800,Other1152,Otherother)
}
}
function ScreenWidth(CSS1,CSS2,CSS3,CSS4){
if ((screen.width == 1024) && (screen.height == 768)){
setActiveStyleSheet(CSS1);
}else{
if ((screen.width == 800) && (screen.height == 600)){
setActiveStyleSheet(CSS2);
}else{
if ((screen.width == 1152) && (screen.height == 864)){
setActiveStyleSheet(CSS3);
}else{
setActiveStyleSheet(CSS4);
}}}
}
function setActiveStyleSheet(title){document.getElementsByTagName("link")[0].href="../Style/"+title;}}网上下了段JS现在只能掉用products.css,1024*768的情况下调用不到~
求教是什么原因