复制代码代码如下:
<! DocType html public "-// w3c // dtd xhtml 1.0 Transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transicional.dtd ">
<html xmlns = "http://www.w3.org/1999/xhtml">
<Evista>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> 可折叠弹出式菜单 </title>
</ablo>
<estilo>
Cuerpo {Color de fondo: #fff; color: #000;}
div {margin-bottom: 10px;}
Ul.Menu {Display: Ninguno; Tipo de estilo listado: Ninguno; Margin-Top: 5px;}
A.Menulink {Font-Size: 16px; Font-Weight: Bold;}
</style>
<script type = "text/javaScript">
Window.Onload = initall;
función initall () {
var alllinks = document.getElementsBytagName ("A");
para (var i = 0; i <alllinks.length; i ++) {
if (alllinks [i] .classname.indexof ("menulink")> -1) {
alllinks [i] .onclick = togglemenu;
}
}
}
function tOgGlEmenu () {
var startMenu = this.href.lastindexof ("/")+1;
var stopMenu = this.href.lastindexof (".");
var thisMenuname = this.href.substring (startmenu, stopMenu);
var thisMenu = document.getElementById (thisMenuname) .style;
if (thisMenu.display == "bloque") {
thisMenu.display = "Ninguno";
}
demás {
thisMenu.display = "bloque";
}
devolver falso;
}
</script>
<Body>
<h1> Shakespeare's Plays </h1>
<div>
<a href = "menú1.html"> comdeis </a>
<ul id = "menú1">
<li> <a href = "pg1.html"> Todo está bien que termina bien </a> </li>
<li> <a href = "pg2.html"> Como te gusta </a> </li>
<li> <a href = "pg3.html"> Love's Labor's Lost </a> </li>
<li> <a href = "pg4.html"> La comedia de errores </a> </li>
</ul>
</div>
<div>
<a href = "menú2.html"> tragedias </a>
<ul id = "menú2">
<li> <a href = "pg5.html"> Anthony & Cleopatra </a> </li>
<li> <a href = "pg6.html"> Hamlet </a> </li>
<li> <a href = "pg7.html"> Romeo y Juliet </a> </li>
</ul>
</div>
<div>
<a href = "menú3.html"> Historias </a>
<ul id = "menú3">
<li> <a href = "pg8.html"> Henry IV, parte1 </a> </li>
<li> <a href = "pg9.html"> Henry IV, parte2 </a> </li>
</ul>
</div>
</body>
</html>