菜单的收起与折叠事例
源码如下:
<script language="javascript">
var nShow = 1;
function switchSysBar()
{
if (document.all("TDTree").style.display == "")
{
document.all("TDTree").style.display = "none"
document.all.A1.innerHTML = "展开<img src='Images/movetoolright1.gif' width='10' height='39' border='0'>";
}
else
{
document.all("TDTree").style.display = "";
document.all.A1.innerHTML = "收起<img src='Images/movetool1.gif' width='10' height='39' border='0'>";
}
}
</script>
</head>
<body leftmargin=0 rightmargin=0>
<form id="form1" runat="server">
<div>
<table align=center id=table1 cellpadding=0 cellspacing=0 border=0>
<tr>
<td valign=top align=center width=80 id="TDTree">
菜单
</td>
<td style="width: 10px"><a style="CURSOR:hand" onClick="switchSysBar()" id="A1"><img src="Images/movetool1.gif" width="10" height="39" border="0"></a></td>
<td vAlign="top" align=left>右面的内容</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<script language="javascript">
var nShow = 1;
function switchSysBar()
{
if (document.all("TDTree").style.display == "")
{
document.all("TDTree").style.display = "none"
document.all.A1.innerHTML = "展开<img src='Images/movetoolright1.gif' width='10' height='39' border='0'>";
}
else
{
document.all("TDTree").style.display = "";
document.all.A1.innerHTML = "收起<img src='Images/movetool1.gif' width='10' height='39' border='0'>";
}
}
</script>
</head>
<body leftmargin=0 rightmargin=0>
<form id="form1" runat="server">
<div>
<table align=center id=table1 cellpadding=0 cellspacing=0 border=0>
<tr>
<td valign=top align=center width=80 id="TDTree">
菜单
</td>
<td style="width: 10px"><a style="CURSOR:hand" onClick="switchSysBar()" id="A1"><img src="Images/movetool1.gif" width="10" height="39" border="0"></a></td>
<td vAlign="top" align=left>右面的内容</td>
</tr>
</table>
</div>
</form>
</body>
</html>