1.我知道分辨率是有系统参数的, 不过我不知道是什么:)
2.换一个判断方式
ru: screen.width < 1024 --说明是 800 的或者更低:)//不知道行不行

解决方案 »

  1.   

    你分辨率判断是正确的--我试过了
    class_name是什么东西啊?
      

  2.   

    <script>
    function bg_screen(class_name,bg_path,lbg_path) {
          if ((screen.width == 800) && (screen.height == 600)) {
            //aa.className = "bodybg2";
            document.getElementById(class_name).style.backgroundColor = bg_path;
          } else if ((screen.width == 1024) && (screen.height == 768)) {
            //aa.className = "bodybg1";        document.getElementById(class_name).style.backgroundColor = lbg_path;
          }
       }</script>
      

  3.   

    "aa"是字符串
    同意楼上document.getElementById
      

  4.   

    <script language="javascript">
    <!--
        //根据分辨率改变背景图
        function bg_screen(class_name,bg_path,lbg_path)
     {
          if ((screen.width == 800) && (screen.height == 600)) {
      
            //aa.className = "bodybg2";
            class_name.background = bg_path;
          } 
      else if ((screen.width == 1024) && (screen.height == 768)) {
       

            //aa.className = "bodybg1";
            class_name.background = lbg_path;
          }
        }//-->
    </script><body id=bodybg1 onload=bg_screen(bodybg1,"image/155863.jpg","image/107198.gif") ></body>
      

  5.   

    晕倒,<script>
    function bg_screen(class_name,bg_path,lbg_path) {
          if ((screen.width == 800) && (screen.height == 600)) {
            //aa.className = "bodybg2";
            document.getElementById(class_name).style.background = bg_path;
          } else if ((screen.width == 1024) && (screen.height == 768)) {
            //aa.className = "bodybg1";        document.getElementById(class_name).style.background = lbg_path;
          }
       }</script>
    这个程序在具体运行的时候提示参数无效