来龙去脉各位请参看:http://expert.csdn.net/Expert/topic/1952/1952472.xml?temp=.1059992

解决方案 »

  1.   

    经过测试,我发现问题所在了,改成这样就可以了!谢谢阿信大虾和孟子E章大虾!!!
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 3</title>
    </head><body>
    <script>
    function oLight(e,flag){e=e.parentNode.parentNode;
    //alert(e.rowIndex);
    //alert(e.rowIndex+flag);//r=document.getElementById('test').childNodes[(e.rowIndex+flag)]
    r=document.getElementById('test').rows[e.rowIndex+flag];temp=e.style.backgroundColor;
    e.style.backgroundColor=r.style.backgroundColor;
    r.style.backgroundColor=temp;
    }
    </script>
    <table border="1" width="100" id=test>
      <tr style="background-color:red">
        <td width="100%"><input type=button value="down" onclick="oLight(this,1)"></td>
      </tr>
      <tr style="background-color:blue">
        <td width="100%"><input type=button value="up" onclick="oLight(this,-1)"><input type=button value="down" onclick="oLight(this,1)"> </td>
      </tr>
      <tr style="background-color:white">
        <td width="100%"><input type=button value=up onclick="oLight(this,-1)"><input type=button value=down onclick="oLight(this,1)"> </td>
      </tr>
      <tr style="background-color:purple">
        <td width="100%"><input type=button value=up onclick="oLight(this,-1)"> </td>
      </tr>
    </table></body></html>
      

  2.   

    我的是ns6.0b,谢谢谢谢!真的感谢救命之恩!