你是不是要这样:将iniMenu改成function iniMenu(tabObj){
    
    var collection = $(tabObj).getElementsByTagName("A");
    var selObj;    for(var i = 0; i < collection.length; i++){
        collection[i].num= i;
        collection[i].onmouseover = function(){
                this.className = 'a01';
                $( tabObj+"_Content" + this.num).style.display="block";
            }
collection[i].onmouseout = function(){
this.className = '';
$( tabObj+"_Content" + this.num).style.display="none";
}
}
}

解决方案 »

  1.   

    先回复再写代码……~
    wait for me~
      

  2.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <style>
    *{ margin:0px;padding:0px; }
    a{text-decoration:none; }
    a:hover{text-decoration:underline;}
    body{font-size:12px;  }
    .hotestBg{ background:#f5ffe6; width:284px; padding:0px 7px; margin:30px; }
    .hotestCont{ border:1px solid #b9e8a0; background:#fff; padding:6px 5px 3px; margin-bottom:5px; display:none; }
    .hotest{ position:relative; width:100%; height:24px; z-index:2; bottom:-1px; }
    .hotest span{ color:#c00; float:left; padding-top:4px; margin-right:1px; }
    .hotest a{ float:left; background:url(http://www.liuhonggang.com/images2/icon07.gif) no-repeat; width:49px; height:18px; padding:6px 0px 0px 3px; top:0; color:#06c;  }
    .hotest a:hover{ color:#f60; text-decoration:none; }
    .hotest a.a01,
    .hotest a.a02,
    .hotest a.a03{ background:url(http://www.liuhonggang.com/images2/icon09.gif) no-repeat; color:#f60  }
    .hotest a.a4{  width:62px; background:url(http://www.liuhonggang.com/images2/icon08.gif) no-repeat;   }
    .hotest a.a04{  width:62px; background:url(http://www.liuhonggang.com/images2/icon10.gif) no-repeat; color:#f60;   }
    .hotestCont a{ color:#333; }</style>
    </head>
    <body>
    <div class="hotestBg">    <div class="hotest" id="tab1">
          <span>热门产品:</span>
          <a class="a1" href="#">笔记本</a>
          <a class="a2" href="#">服务器</a>
          <a class="a3" href="#">台式机</a>
          <a class="a4" href="#">数码相机</a>
          <div class="clear"></div>
        </div>
    <div id="tab1_Content">
        <div class="hotestCont">
          <a href="#">ThinkPad</a> <a href="#">华硕</a> <a href="#">联想</a> <a href="#">戴尔</a>
        </div>    <div class="hotestCont">
          <a href="#">宏基</a> <a href="#">惠普</a> <a href="#">索尼</a> <a href="#">戴尔</a>
        </div>    <div class="hotestCont">
          <a href="#">ThinkPad</a> <a href="#">华硕</a> <a href="#">联想</a> <a href="#">戴尔</a>
          <a href="#">宏基</a> <a href="#">惠普</a>
        </div>    <div class="hotestCont">
          <a href="#">ThinkPad</a> <a href="#">华硕</a> <a href="#">联想</a> <a href="#">戴尔</a>
          <a href="#">宏基</a> <a href="#">惠普</a> <a href="#">索尼</a> <a href="#">戴尔</a>
        </div>
    </div>
    </div><script language="JavaScript" type="text/javascript">
    <!--
    function $(id){    
        return document.getElementById(id)
    }
    function iniMenu(tabObj){
        var collection = $(tabObj).getElementsByTagName("A");    for(var i = 0; i < collection.length; i++){
            collection[i].onmouseover = function(){
             showMenu(this);        
            }
        }
    }
    function showMenu(Obj){
    var x=$("tab1").getElementsByTagName("A");
    var y=$("tab1_Content").getElementsByTagName("div");
    for(var i=0;i<x.length;i++){
    if(x[i]==Obj){
    x[i].className = 'a01';
    y[i].style.display='block';
    }else{
    x[i].className = '';
    y[i].style.display='none';
    }
    }
    }iniMenu('tab1');//-->
    </script>
    </body>
    </html>
      

  3.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><style>
    *{ margin:0px;padding:0px; }
    a{text-decoration:none; }
    a:hover{text-decoration:underline;}
    body{font-size:12px;  }
    .hotestBg{ background:#f5ffe6; width:284px; padding:0px 7px; margin:30px; }
    .hotestCont{ border:1px solid #b9e8a0; background:#fff; padding:6px 5px 3px; margin-bottom:5px; display:none; }
    .hotest{ position:relative; width:100%; height:24px; z-index:2; bottom:-1px; }
    .hotest span{ color:#c00; float:left; padding-top:4px; margin-right:1px; }
    .hotest a{ float:left; background:url(http://www.liuhonggang.com/images2/icon07.gif) no-repeat; width:49px; height:18px; padding:6px 0px 0px 3px; top:0; color:#06c;  }
    .hotest a:hover{ color:#f60; text-decoration:none; }
    .hotest a.a01,
    .hotest a.a02,
    .hotest a.a03{ background:url(http://www.liuhonggang.com/images2/icon09.gif) no-repeat; color:#f60  }
    .hotest a.a4{  width:62px; background:url(http://www.liuhonggang.com/images2/icon08.gif) no-repeat;   }
    .hotest a.a04{  width:62px; background:url(http://www.liuhonggang.com/images2/icon10.gif) no-repeat; color:#f60;   }
    .hotestCont a{ color:#333; }</style><body>
    <div class="hotestBg">    <div class="hotest" id="tab1">
          <span>热门产品:</span>
          <a class="a1" href="#">笔记本</a>
          <a class="a2" href="#">服务器</a>
          <a class="a3" href="#">台式机</a>
          <a class="a4" href="#">数码相机</a>
          <div class="clear"></div>
        </div>    <div class="hotestCont" id='tab1_Content0'>
          <a href="#">ThinkPad</a> <a href="#">华硕</a> <a href="#">联想</a> <a href="#">戴尔</a>
        </div>    <div class="hotestCont" id='tab1_Content1' >
          <a href="#">宏基</a> <a href="#">惠普</a> <a href="#">索尼</a> <a href="#">戴尔</a>
        </div>    <div class="hotestCont" id='tab1_Content2' >
          <a href="#">ThinkPad</a> <a href="#">华硕</a> <a href="#">联想</a> <a href="#">戴尔</a>
          <a href="#">宏基</a> <a href="#">惠普</a>
        </div>    <div class="hotestCont" id='tab1_Content3' >
          <a href="#">ThinkPad</a> <a href="#">华硕</a> <a href="#">联想</a> <a href="#">戴尔</a>
          <a href="#">宏基</a> <a href="#">惠普</a> <a href="#">索尼</a> <a href="#">戴尔</a>
        </div>
    </div><script language="JavaScript" type="text/javascript">
    <!--
    function $(id){    
        return document.getElementById(id)
    }
    function iniMenu(tabObj){
        
        var collection = $(tabObj).getElementsByTagName("A");
        var selObj;    for(var i = 0; i < collection.length; i++){
            collection[i].num= i;
            collection[i].onmouseover = function(){
                    this.className = 'a01';
                    $( tabObj+"_Content" + this.num).style.display="block";
            }
    collection[i].onmouseout = function(){
    this.className = 'a' + (this.num+1);
    $( tabObj + "_Content" + this.num).style.display = "none";
    }
        }}iniMenu('tab1');//-->
    </script></body>
    </html>
      

  4.   

    谢谢stayalive , 我忘了说了,鼠标移开后要恢复成默认的样子。
    这里怎么修改不了自己发的帖子呢。