<!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=utf-8" />
<title>left</title>
<link rel="stylesheet" href="css/base.css" type="text/css">
</head>
<script language="javascript"> 
 function hideAll() { 
    for(i=0;i<odiv.length;i++) { 
        odiv[i].style.display="none"; 
   } 
 }
 function showObj(num) { 
    if (odiv[num].style.display=="none") { 
        hideAll(); 
        odiv[num].style.display="inline"; 
    }else { 
        odiv[num].style.display="none"; 
    } 
 } 
</script>
<body bgcolor=Lavender>
<table>
<tr align ="left" height ="10">
     <img src="menu.bmp" width="144" height="60">
</tr>
<tr   height="20"></tr>
<!--***** 情報セキュリティ *****-->
<TR>
<TD WIDTH="40" ALIGN="CENTER">
<A HREF="security.html" onMouseOver="window.status='';return true" target="_parent">
<IMG SRC="blue.gif" BORDER="0" WIDTH="15" HEIGHT="15"></A>
</TD>
<TD WIDTH="140">
<A href="security.html" target="_parent" onMouseOver=this.style.color="#F75000" onMouseOut=this.style.color="#930093">
<B>情報セキュリティ</B>
</A>
</TD>
</TR><!--***** 座席表 *****-->
<TR>
<TD WIDTH="40" ALIGN="CENTER">
<A HREF="main.html" onMouseOver="window.status='';return true" target="_parent">
<IMG SRC="green.gif" BORDER="0" WIDTH="15" HEIGHT="15"></A>
</TD>
<TD WIDTH="140">
<A href="main.html" target="_parent" onMouseOver=this.style.color="#F75000" onMouseOut=this.style.color="#930093">
<B>座席表</B>
</A>
</TD>
</TR>
<!--***** 社員マスタ *****-->
<TR>
<TD WIDTH="40" valign="top" ALIGN="CENTER">
<A HREF="main2.html" onMouseOver="window.status='';return true" target="_parent">
<IMG SRC="red.gif" BORDER="0" WIDTH="15" HEIGHT="15"></A>
</TD>
<TD WIDTH="140">
<a href="#" onclick="showObj(0)" onMouseOut=this.style.color="blue">
社員マスタ
</a>
<br>
<div id="odiv" style="display:none" >
<a href="person-create.html" target="mainFrame" onMouseOver=this.style.color="#F75000" onMouseOut=this.style.color="#930093">社員入社</a><br> 
<a href="person-manage.html" target="mainFrame" onMouseOver=this.style.color="#F75000" onMouseOut=this.style.color="#930093">社員情報管理</a><br>
</div>
</TD>
</tr>
<tr>
<td>
<a href="#" ></a><br> 
<div id="odiv" style="display:none" >
</div>
</td>
</tr>
</table>
</body>
</html>
为什么把 <td>
<a href="#" ></a><br> 
<div id="odiv" style="display:none" >
</div>
</td>
删了最下面的那个菜单的下拉式就不能显示了。

解决方案 »

  1.   

    你删除了那段代码后,odiv就是dom元素了,而非dom元素数组了因为你有两个id为odiv的div控件
      

  2.   

    同意楼上,你要是想删除的话,把odiv[num]改成odiv就可以了
      

  3.   


    function showObj(num) { 
        if (odiv.style.display=="none") { 
            hideAll(); 
            odiv.style.display="inline"; 
        }else { 
            odiv.style.display="none"; 
        }