通过判断screen.height和screen.width来动态切换css文件

解决方案 »

  1.   

    具体怎么写呢?楼上的能详细说明下吗
    css就不用说了 ,script具体怎么写?
      

  2.   

    if (screen.width>800) {
    alert("1024");
    } else {
    alert("800");
    // to do..
    }
      

  3.   

    都写成这样了 
    就不能把好人做到底具体些吗?
    1024的是css1   800的是css2明天就要用了  大家帮忙下啊 汗奔~~
      

  4.   

    关键是怎么让script去自动执行2个css
      

  5.   

    <script type="text/javascript">
      //<![CDATA[
    if (screen.width>800) {
    document.write("<link rel='stylesheet' href='1.css' type='text/css'>");
    } else {
    document.write("<link rel='stylesheet' href='2.css' type='text/css'>");
    }
      //]]>
      </script>