在写背景的div上加上唯一ID值,
写javascript程序,根据ID名更换
src=路径+图片文件名

解决方案 »

  1.   

    onlick=this.style.backgroud='../images/bg.gif'
      

  2.   

    <table border="1" width="400" cellspacing="0" cellpadding="0">
        <tr onmouseover="this.style.background='#222'; " onmouseout ="this.style.background=''; this.style.borderColor=''" >
          <td width="49"> </td>
          <td width="49"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
        </tr>
        <tr onmouseover="this.style.background='#222'; " onmouseout ="this.style.background=''; this.style.borderColor=''" >
          <td width="49"> </td>
          <td width="49"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
          <td width="50"> </td>
        </tr>
      </table>
    也可以用图片做单元格背景,同理!