日期:2014-05-16  浏览次数:20293 次

真心求教如何用javascript做集合菜单,做出的效果就和左边的一样---一个“+”号,点一下后就展开很多的子菜单,有源代码的更好!
真心求教如何用javascript做集合菜单,做出的效果就和左边的一样---一个“+”号,点一下后就展开很多的子菜单,有源代码的更好!

------解决方案--------------------
http://www.leftworld.net/javascript/20020531menu2.htm
可以下来试试!
------解决方案--------------------
看:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<html>
<head>
<title> New Document </title>
<meta name= "Generator " content= "EditPlus ">
<meta name= "Author " content= " ">
<meta name= "Keywords " content= " ">
<meta name= "Description " content= " ">
</head>

<body>
<script language=JavaScript1.2>
<!--
function showsubmenu(sid) {
var whichEl = eval( "submenu " + sid);
var switchFolder = eval( "switchFolder " + sid);
var plusMinus = eval( "plusMinus " + sid);
if (whichEl.style.display == "none "){
eval( "submenu " + sid + ".style.display=\ "\ "; ");
if (sid == 2) {
plusMinus.src= "images/icon/ftv2mlastnode.gif ";
}else{
plusMinus.src= "images/icon/ftv2mnode.gif ";
switchFolder.src= "images/icon/ftv2folderopen.gif ";
}
}else{
eval( "submenu " + sid + ".style.display=\ "none\ "; ");
if (sid == 2) {
plusMinus.src= "images/icon/ftv2plastnode.gif ";
}else{
plusMinus.src= "images/icon/ftv2pnode.gif ";
switchFolder.src= "images/icon/ftv2folderclosed.gif ";
}
}
}
//-->
</script>
<table width= "778 " border= "0 " align= "center " height= "100 " cellspacing= "0 " cellpadding= "0 " class= "tableborder ">
<tr valign= "top ">
<td width= "15% " id= "frame " name= "frame " class= "UserLeft ">
<!--树型菜单开始-->
<table width= "150 " border= "0 " align= "center " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td height= "5 "> </td>
</tr>
<tr>
<td height= "16 "> <img src= "images/icon/user_manager.gif " width= "22 " height= "16 " align= "absmiddle " /> <strong> <a href= "main.asp " target= "main "> 用户控制面板 </a> </strong> </td>
</tr>
</table>
<table width= "150 " border= "0 " align= "center " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td onclick= "showsubmenu(0) "> <img id=plusMinus0 src= "images/icon/ftv2mnode.gif " width= "16 " height= "22 " align= "absmiddle " /> <img id= "switchFolder0 " src= "images/icon/ftv2folderopen.gif " width= "24 " height= "16 " align= "texttop " /> 服务中心 </td>
</tr>
<tr>
<td style= "display: " id= "submenu0 "> <table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td> <img src= "images/icon/ftv2vertline.gif &