复制代码代码如下:
<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // pt" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-bransitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<Title> 可折叠弹出式菜单 </title>
</head>
<estilo>
Corpo {Background-Color: #fff; cor: #000;}
div {Margin-Bottom: 10px;}
Ul.Menu {Display: Nenhum; tipo de lista de listagem: nenhum; margem-top: 5px;}
a.menulink {font-size: 16px; font-weight: Bold;}
</style>
<script type = "text/javascript">
window.onload = Initall;
function initall () {
var allLinks = document.getElementsByTagName ("A");
for (var i = 0; i <allLinks.length; i ++) {
if (alllinks [i] .className.indexof ("Menulink")> -1) {
alllinks [i] .OnClick = togGlemenu;
}
}
}
função togglemenu () {
var startMenu = this.href.LastIndexOf ("/")+1;
var stopmenu = this.href.LastIndexOf (".");
var thisMenununame = this.href.substring (startmenu, stopmenu);
var thisMenu = document.getElementById (thisMenununame) .style;
if (thisMenu.Display == "Block") {
thismenu.display = "nenhum";
}
outro {
thismenu.display = "bloco";
}
retornar falso;
}
</script>
<Body>
<H1> peças de Shakespeare </h1>
<div>
<a href = "menu1.html"> comdeis </a>
<ul id = "menu1">
<li> <a href = "pg1.html"> tudo está bem que termina bem </a> </li>
<li> <a href = "pg2.html"> como você gosta </a> </li>
<li> <a href = "pg3.html"> o trabalho do amor perdido </a> </li>
<li> <a href = "pg4.html"> a comédia de erros </a> </li>
</ul>
</div>
<div>
<a href = "menu2.html"> tragédias </a>
<ul id = "menu2">
<li> <a href = "pg5.html"> Anthony & Cleopatra </a> </li>
<li> <a href = "pg6.html"> hamlet </a> </li>
<li> <a href = "pg7.html"> romeo & juliet </a> </li>
</ul>
</div>
<div>
<a href = "menu3.html"> histórias </a>
<ul id = "menu3">
<li> <a href = "pg8.html"> henry iv, parte1 </a> </li>
<li> <a href = "pg9.html"> henry iv, parte2 </a> </li>
</ul>
</div>
</body>
</html>