下面的是我最初用的示例:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="aleft.aspx.cs" Inherits="Admin_Admin_left" % >
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd" >
<html >
<head >
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
<title > </title >
<script language=javascript >
function menuShow(obj,maxh,obj2)
{
if(obj.style.pixelHeight <maxh)
{
obj.style.pixelHeight+=maxh/10;
obj.filters.alpha.opacity+=20;
obj2.bgcolor="green";
if(obj.style.pixelHeight==maxh/10)
obj.style.display= 'block ';
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout( 'menuShow(myObj,myMaxh,myObj2) ', '5 ');
}
}
function menuHide(obj,maxh,obj2)
{
if(obj.style.pixelHeight >0)
{
if(obj.style.pixelHeight==maxh/5)
obj.style.display= 'none ';
obj.style.pixelHeight-=maxh/5;
obj.filters.alpha.opacity-=10;
obj2.bgcolor="black";
myObj=obj;
myMaxh=maxh
myObj2=obj2;
setTimeout( 'menuHide(myObj,myMaxh,myObj2) ', '5 ');
}
else
if(whichContinue)
whichContinue.click();
}
function menuChange(obj,maxh,obj2)
{
if(obj.style.pixelHeight)
{
menuHide(obj,maxh,obj2);
whichOpen= ' ';
whichcontinue= ' ';
}
else
if(whichOpen)
{
whichContinue=obj2;
whichOpen.click();
}
else
{
menuShow(obj,maxh,obj2);
whichOpen=obj2;
whichContinue= ' ';
}
}
</script >
<script language=javascript >
var whichOpen="";
var whichContinue= ' ';
</script >
</head >
<body leftmargin="0" topmargin="0" bgcolor="#FF9800" >
<table cellSpacing=0 cellPadding=0 width=158 align=center >
<tbody >
<tr style="CURSOR: pointer" >
<td class=menu_title id=menuTitle2
onmouseover="this.className= 'menu_title2 ';"
onclick=menuChange(menu2,30,menuTitle2);
onmouseout="this.className= 'menu_title ';"
bgcolor=blue
height=25 > <span >A </span > </td >
</tr >
<tr >
<td valign="middle" >
<div class=sec_menu id=menu2
style="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 158px; HEIGHT: 0px" >
<table cellSpacing=2 cellPadding=0 width=135 align=center >
<tr >
<td style="height: 25px" > <a href="#" target="BoardList" >ccc </a > </td >
</tr >
<tr >
<td style="height: 25px" > <a href="#" target="BoardList" >ddd </a > </td >
</tr >
</table >
</div > </td > </tr > </tbody > </table >
<br >
<table cellSpacing=0 cellPadding=0 width=158 align=center >
<tbody >
<tr style="CURSOR: pointer" >
<td class=menu_title id=menuTitle4
onmouseover="this.className= 'menu_title2 ';"
onclick=menuChange(menu4,30,menuTitle4);
onmouseout="this.className= 'menu_title ';"
bgcolor=blue
height=25 > <span >B </span > </td >
</tr >
<tr >
<td valign="middle" > <div class=sec_menu id=menu4
style="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 158px; HEIGHT: 0px" >
<table cellSpacing=2 cellPadding=0 width=135 align=center >
<tr >
<td style="height: 25px" > <a href="#" target="BoardList" >aaa </a > </td >
</tr >
<tr >
<td style="height: 24px" > <a href="#" target="BoardList" >bbb </a > </td >
</tr >
</table >
</div > </td >
</tr >
</tbody >
</table >
</body >
</html
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd" >
<html >
<head >
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
<title > </title >
<script language=javascript >
function menuShow(obj,maxh,obj2)
{
if(obj.style.pixelHeight <maxh)
{
obj.style.pixelHeight+=maxh/10;
obj.filters.alpha.opacity+=20;
obj2.bgcolor="green";
if(obj.style.pixelHeight==maxh/10)
obj.style.display= 'block ';
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout( 'menuShow(myObj,myMaxh,myObj2) ', '5 ');
}
}
function menuHide(obj,maxh,obj2)
{
if(obj.style.pixelHeight >0)
{
if(obj.style.pixelHeight==maxh/5)
obj.style.display= 'none ';
obj.style.pixelHeight-=maxh/5;
obj.filters.alpha.opacity-=10;
obj2.bgcolor="black";
myObj=obj;
myMaxh=maxh
myObj2=obj2;
setTimeout( 'menuHide(myObj,myMaxh,myObj2) ', '5 ');
}
else
if(whichContinue)
whichContinue.click();
}
function menuChange(obj,maxh,obj2)
{
if(obj.style.pixelHeight)
{
menuHide(obj,maxh,obj2);
whichOpen= ' ';
whichcontinue= ' ';
}
else
if(whichOpen)
{
whichContinue=obj2;
whichOpen.click();
}
else
{
menuShow(obj,maxh,obj2);
whichOpen=obj2;
whichContinue= ' ';
}
}
</script >
<script language=javascript >
var whichOpen="";
var whichContinue= ' ';
</script >
</head >
<body leftmargin="0" topmargin="0" bgcolor="#FF9800" >
<table cellSpacing=0 cellPadding=0 width=158 align=center >
<tbody >
<tr style="CURSOR: pointer" >
<td class=menu_title id=menuTitle2
onmouseover="this.className= 'menu_title2 ';"
onclick=menuChange(menu2,30,menuTitle2);
onmouseout="this.className= 'menu_title ';"
bgcolor=blue
height=25 > <span >A </span > </td >
</tr >
<tr >
<td valign="middle" >
<div class=sec_menu id=menu2
style="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 158px; HEIGHT: 0px" >
<table cellSpacing=2 cellPadding=0 width=135 align=center >
<tr >
<td style="height: 25px" > <a href="#" target="BoardList" >ccc </a > </td >
</tr >
<tr >
<td style="height: 25px" > <a href="#" target="BoardList" >ddd </a > </td >
</tr >
</table >
</div > </td > </tr > </tbody > </table >
<br >
<table cellSpacing=0 cellPadding=0 width=158 align=center >
<tbody >
<tr style="CURSOR: pointer" >
<td class=menu_title id=menuTitle4
onmouseover="this.className= 'menu_title2 ';"
onclick=menuChange(menu4,30,menuTitle4);
onmouseout="this.className= 'menu_title ';"
bgcolor=blue
height=25 > <span >B </span > </td >
</tr >
<tr >
<td valign="middle" > <div class=sec_menu id=menu4
style="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 158px; HEIGHT: 0px" >
<table cellSpacing=2 cellPadding=0 width=135 align=center >
<tr >
<td style="height: 25px" > <a href="#" target="BoardList" >aaa </a > </td >
</tr >
<tr >
<td style="height: 24px" > <a href="#" target="BoardList" >bbb </a > </td >
</tr >
</table >
</div > </td >
</tr >
</tbody >
</table >
</body >
</html