这是一个导航,有6个标题,鼠标移入时变色,移开时灰色,我都设置好了,为什么不变呢?

解决方案 »

  1.   

    CSS JS文件跟一下Alert出来 简化的话用JQuery 
      

  2.   

    <table width=200>
       <tr>
            <td bgcolor="#738278" style="cursor:hand"  onMouseOver="this.style.backgroundColor='red'" onMouseOut="this.style.background='#738278'">
    移過來
              </td>
       </tr>
    </table>
      

  3.   

    JavaScript:onmousemove="this.style.class=''"
      

  4.   

    应该是onmouseover="this.style.backgroundColor='#FFFFFF'"或
    onmouseout="this.style.backgroundColor:Red;"
      

  5.   

     <script language="javascript" type="text/javascript">
        
        
    var slef = "";
    var num = Math.round(Math.random() * 5);
    function ajaxTab(index) {
    slef = setTimeout("wait(" + index + ")", 500);

    }
    $(function load() {
    ajaxTab(num);

    })
    //等待
    function wait(index) {
    $.ajaxTab({
    Content: '#tabContent > div.contentForAjaxTab',
    Content1: '#showImg > li.homeImg', Index: index
    });
    }
    function clearThread() {
    clearTimeout(slef);
    document.getElementById("lab1").style.background="#868686";

    }

        </script>
    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                        <tbody>
                            <tr>
                                <td id="lab1" style="display: block; background-color:#868686;" onmouseover="javascript:ajaxTab(0);" onmouseout="clearThread()" class="bgcolor('lab1')">
                                    <h1 class="text_small text_home">
                                        <a style="color: white; font-weight: bold" id="CPH1_ctl01_hlEC" class="HLItem" href="#">
                                            数据采集卡</a></h1>
                                </td>
                                <td id="lab2" style="display: block; background-color:#868686;" onmouseover="javascript:ajaxTab(1);" onmouseout="clearThread()" class="bgcolor(lab2)">
                                    <h1 class="text_small text_home">
                                        <a style="color: white; font-weight: bold" id="CPH1_ctl01_hlEA" class="HLItem" href="#">
                                            全隔离调理模块</a></h1>
                                </td>
                                <td id="lab3" style="display: block; background-color:#868686;" onmouseover="javascript:ajaxTab(2);" onmouseout="clearThread()">
                                    <h1 class="text_small text_home">
                                        <a style="color: white; font-weight: bold" id="CPH1_ctl01_hlApplied" class="HLItem"
                                            href="#">外围端子板</a></h1>
                                </td>
                                
                                <td id="lab4" style="display: block; background-color:#868686;" onmouseover="javascript:ajaxTab(3);" onmouseout="clearThread()">
                                    <h1 class="text_small text_home">
                                        <a style="color: white; font-weight: bold" id="CPH1_ctl01_hlINC" class="HLItem" href="#">
                                            HMI工业电脑</a></h1>
                                </td>
                                <td style="width: 150px; border-right: 0px; display: block; background-color:#868686;" id="lab5" onmouseover="javascript:ajaxTab(4);"
                                    onmouseout="clearThread()">
                                    <h1 class="text_small text_home">
                                        <a style="color: white; font-weight: bold" id="CPH1_ctl01_HyperLink1" class="HLItem"
                                            href="http://www.advantech.com.cn/ais/">远程IO模块/多串口卡</a></h1>
                                </td>
                            </tr>
                        </tbody>
    </table>
      

  6.   

    这个小特效完全可以用css,不需要写一点JS.
      

  7.   

    看你的JS代码还有你的CSS设置