二级树形菜单打开时再点其他菜单时如何将以前的子菜单自动缩回?

hamier_hu 2004-07-21 04:43:39
这是我现在做的二级树形菜单不能缩的代码,如何让其自动再缩回去?
<html><head>
</head>
<body>
<script>
var he=document.body.clientHeight
document.write("<div id=tt style=height:"+he+";overflow:hidden>")
</script>
<table cellpadding="0" cellspacing="0">
<tr>
<td width="130" id="menuTitle1" style="cursor:hand" onclick="showsubmenu(3)" onmouseover="this.className='menu_title2';" onmouseout="this.className='menu_title';"><a href="#"><img src="images/index_images/index_button_0002.gif" name="Image21" width="130" height="15" border="0" id="Image21"></a></td>
</tr>
<tr>
<td id="submenu3" style="DISPLAY: none"><div style="WIDTH: 130px">
<table cellspacing="0" cellpadding="0" width="80%" >
<tr>
<td height="15"><a href="index.htm"><img src="images/button-02/01_1.gif" name="Image121" width="130" height="15" border="0" id="Image1"></a></td>
</tr>
<tr>
<td > <a href="index.htm"><img src="images/button-02/03_1.gif" name="Image12" width="130" height="30" border="0" id="Image1"></a></td>
</tr>
</table>
</div></td>
</tr>
</table>
</tbody>
</table>
<table cellspacing="0" cellpadding="0" width="130" align="left">
<tr>
<td width="130" id="menuTitle1" style="cursor:hand" onclick="showsubmenu(4)" onmouseover="this.className='menu_title2';" onmouseout="this.className='menu_title';" ><img src="images/index_images/index_button_0009.gif" name="Image91" width="130" id="Image31"></td>
</tr>
<tr>
<td id="submenu4" style="DISPLAY: none"><div style="WIDTH: 130px">
<table cellspacing="0" cellpadding="0" width="130" >
<tr>
<td width="130" height="15"><a href="index.htm"><img src="images/button-02/34_1.gif" name="Image12321111131211" width="130" border="0" id="Image1"></a></td>
</tr>
<tr>
<td ><a href="index.htm"><img src="images/button-02/31_1.gif" name="Image123211111311" width="130" border="0" id="Image1"></a></td>
</tr>
<tr>
<td ><a href="index.htm"><img src="images/button-02/34_1.gif" name="Image12321111131212" width="130" height="23" border="0" id="Image1"></a></td>
</tr>
</table>
</div></td>
</tr>
</table>
<script>
function aa(Dir)
{tt.doScroll(Dir);Timer=setTimeout('aa("'+Dir+'")',100)}//这里100为滚动速度
function StopScroll(){if(Timer!=null)clearTimeout(Timer)}

function initIt(){
divColl=document.all.tags("DIV");
for(i=0; i<divColl.length; i++) {
whichEl=divColl(i);
if(whichEl.className=="child")whichEl.style.display="none";}
}
function expands(el) {
whichEl1=eval(el+"Child");
if (whichEl1.style.display=="none"){
initIt();
whichEl1.style.display="block";
}else{whichEl1.style.display="none";}
}
var tree= 0;
function loadThreadFollow(){
if (tree==0){
document.frames["hiddenframe"].location.replace("tree.asp");
tree=1
}
}

function showsubmenu(sid)
{
whichEl = eval("submenu" + sid);
if (whichEl.style.display == "none")
{
eval("submenu" + sid + ".style.display=\"\";");
}
else
{
eval("submenu" + sid + ".style.display=\"none\";");
}
}
</script>
...全文
191 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hreoghost 2005-08-06
  • 打赏
  • 举报
回复
mark...

确实不好分析...
hamier_hu 2004-07-21
  • 打赏
  • 举报
回复
拷到dreamweaver里就不乱了
henzaihuni 2004-07-21
  • 打赏
  • 举报
回复
代码太乱了,看的头大
hamier_hu 2004-07-21
  • 打赏
  • 举报
回复
怎么没人回话啊?

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧