selfObj.parentElement.background=url(images/over.gif)selfObj.parentElement.background=url(images/out.gif)

解决方案 »

  1.   


    <script type="text/javascript">
    function MdyOverBG(selfObj){
        selfObj.style.background="url(images/over.gif)";
    }
    function MdyOutBG(selfObj){
        selfObj.style.background="url(images/out.gif)";
    }
    </script>
    <table border="0" width="22%" id="table1" height="27" cellspacing="0" cellpadding="0">
        <tr>
            <td style="background-image: url('images/out.gif')" align="center" onmouseover="MdyOverBG(this)" onmouseout="MdyOutBG(this)"><a>最近更新</a></td>
            <td style="background-image: url('images/out.gif')" align="center" onmouseover="MdyOverBG(this)" onmouseout="MdyOutBG(this)"><a>今日推荐</a></td>
        </tr>
    </table>
      

  2.   

    这儿错在什么地方了:<style>   
      .pic1{background:url(images/mf_l.gif)}   
      .pic2{background:url(images/mf_lv.gif)}   
    </style>   
    <table border="0" width="22%" id="table1" height="37" cellspacing="0" cellpadding="0">
    <tr>
    <td id="aa" onmouseover="this.style.background='mf_lv.gif';bb.style.background='mf_l.gif'" class="pic1"><a href="">最近更新</a></td>
    <td id="bb" onmouseover="this.style.background='mf_lv.gif';aa.style.background='mf_l.gif'" class="pic1"><a href="">今日推荐</a></td>
    </tr>
    </table>
      

  3.   

    我需要这个效果,可是运行时发生错误: <td id="aa" onmouseover="this.style.background='mf_lv.gif';bb.style.background='mf_l.gif'" class="pic1"><a href="">最近更新</a></td>
    <td id="bb" onmouseover="this.style.background='mf_lv.gif';aa.style.background='mf_l.gif'" class="pic1"><a href="">今日推荐</a></td>我该修改哪儿?
      

  4.   

    一、
    this.style.background='mf_lv.gif'
    改成
    this.style.background='url(mf_lv.gif)'二、
    没有onmouseout事件
      

  5.   

    还有 bb.style.background='mf_l.gif' --> bb.style.background='url(mf_l.gif)'