解决方案 »

  1.   

    用css
    td:hover {
    background:#000;
    }
      

  2.   

    window.setTimeout(function(){td.style.color='red'},100)?
    自动变色是什么意思啊
      

  3.   

    试试这个setInterval<!DOCTYPE html>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <title>无标题文档</title>
        <style type="text/css">
        *{margin:0;}
        table,td {
        border:none;
        }
        #fix{ background:#F00!important;}
        </style>
      </head>
      <body>
        <table width="500" height="500" border="1">
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td id="fix">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
        <script type="text/javascript">
        var aTd = document.getElementsByTagName("table")[0].getElementsByTagName("td");
        
        window.setInterval(function(){ for(var i = 0; i < aTd.length; i++){
        
        var iR = Math.floor(256 * Math.random());
        var iG = Math.floor(256 * Math.random());
        var iB = Math.floor(256 * Math.random());
        aTd[i].style.backgroundColor = "rgb(" + iR + "," + iG + "," + iB + ")";
        }},1000);
        </script>
      </body>
    </html>