首页 新闻 搜索 专区 学院

用javascript实现以个纵向菜单,点击一项其他隐藏显示。为什么在ie6上不起作用,在ie7,ie8都能行

0
[已关闭问题] 关闭于 2011-09-21 18:00

<script language="javascript" type="text/javascript">
 window.onload=function InitDIV(){

          document.getElementById("div1").style.display="block";
          document.getElementById("div2").style.display="none";
          document.getElementById("div3").style.display="none";
          document.getElementById("div4").style.display="none";
         }
         function show1(){
           document.getElementById("div1").style.display="block";
           document.getElementById("div2").style.display="none";
           document.getElementById("div3").style.display="none";
           document.getElementById("div4").style.display="none";
         }
         function show2(){
           document.getElementById("div1").style.display="none";
           document.getElementById("div2").style.display="block";
           document.getElementById("div3").style.display="none";
           document.getElementById("div4").style.display="none";
         }
         function show3(){
           document.getElementById("div1").style.display="none";
           document.getElementById("div2").style.display="none";
           document.getElementById("div3").style.display="block";
           document.getElementById("div4").style.display="none";
         }
         function show4(){
           document.getElementById("div1").style.display="none";
           document.getElementById("div2").style.display="none";
           document.getElementById("div3").style.display="none";
           document.getElementById("div4").style.display="block";
         }
</script>
<table width="160" border="0" style=" font-size:12px; margin:0px;" cellpadding="0" cellspacing="0" >
  <tr>
    <td width="154"><img src="Images/l7_11.jpg" width="197" height="34" onclick="show1()" /></td>
  </tr>
  <tr>
    <td   align="center"><div id="div1" style="width:190; border:0px; margin:0px;"><table width="186" border="0"  style="background-color:#ffffff; " cellpadding="0" cellspacing="0">  
 
 
   <tr style="line-height:15px;">
        <td  valign="middle">
            
                             <a href="chanpintype.asp?tid=<%=rsp("TypeId")%>"><%=rsp("Title")%></a>
                
                    
   </td>
      </tr>
     
 
    
    </table>
    </div></td>
  </tr>
 
  <tr>
    <td><img src="Images/l7_18.jpg" width="197" height="34" onclick="show2()" /></td>
  </tr>  
  <tr>
    <td align="center"><div id="div2" style="width:190px; height:auto; display:; "><table width="186" border="0"  style="background-color:#ffffff;" cellpadding="0" cellspacing="0">
          <tr>
        <td style="height:15px;"><a href="chanpintype.asp?tid=<%=rsp3("TypeId")%>"><%=rsp3("Title")%></a> </td>
      </tr>
      <tr>
        <td style="height:1px; line-height:1px;"><hr  /></td>
      </tr>
     
    </table></div></td>
  </tr>
   <tr>
    <td style="height:2px;"></td>
  </tr>
  <tr>
    <td><img src="Images/l7_20.jpg" width="197" height="34" onclick="show3()" /></td>
  </tr>
  <tr>
    <td align="center"><div id="div3" style="width:190px; height:auto; display:;"><table width="186" border="0"  style="background-color:#ffffff;" cellpadding="0" cellspacing="0">
        <tr>
        <td style="height:15px;"><a href="chanpintype.asp?tid=<%=rsp4("TypeId")%>"><%=rsp4("Title")%></a> </td>
      </tr>
      <tr>
        <td style="height:1px; line-height:1px;"><hr  /></td>
      </tr>
      
    </table></div></td>
  </tr>
   <tr>
    <td style="height:2px;"></td>
  </tr>
  <tr>
    <td><img src="Images/l7_22.jpg" width="197" height="34" onclick="show4()" /></td>
  </tr>
  <tr>
    <td align="center"><div id="div4" style="width:190px; height:auto; display:;"><table width="186" border="0"  style="background-color:#ffffff;" cellpadding="0" cellspacing="0">
      <tr>
        <td style="height:15px;"><a href="chanpintype.asp?tid=<%=rsp5("TypeId")%>"><%=rsp5("Title")%></a> </td>
      </tr>
      <tr>
        <td style="height:1px; line-height:1px;"><hr  /></td>
      </tr>
      
    </table></div></td>
  </tr>
</table>

xiaoqingqige的主页 xiaoqingqige | 初学一级 | 园豆:7
提问于:2011-06-21 18:48
< >
分享
所有回答(1)
0

怎么没人呢

xiaoqingqige | 园豆:7 (初学一级) | 2011-09-21 17:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册