复制代码代码如下::
<! DocType html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transsitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<kopf>
<meta http-äquiv = "content-type" content = "text /html; charset = utf-8" />
<title> 可折叠弹出式菜单 </title>
</head>
<Styles>
Körper {Hintergrundfarbe: #fff; Farbe: #000;}
div {margin-bottom: 10px;}
Ul.Menu {Anzeige: Keine; Listenstil-Typ: Keine; Margin-Top: 5px;}
A.Menulink {Schriftgröße: 16px; Schriftgewicht: BOLD;}
</style>
<script type = "text/javaScript">
window.onload = initall;
Funktion initall () {
var Alllinks = document.getElementsByTagName ("a");
für (var i = 0; i <alllinks.length; i ++) {
if (Alllinks [i] .className.indexof ("Menulink")> -1) {
Alllinks [i] .onclick = Togglemenu;
}
}
}
Funktion Togglemenu () {
var startMenu = this.href.lastindexof ("/")+1;
var stopmenu = this.href.lastindexof (".");
var thisMenuname = this.href.substring (startmenu, stopmenu);
var thisMenu = document.getElementById (thisMeName) .style;
if (thisMenu.display == "Block") {
thismenu.display = "keine";
}
anders {
thismenu.display = "block";
}
false zurückgeben;
}
</script>
<body>
<h1> Shakespeares Spiele </h1>
<div>
<a href = "mseu1.html"> comdeis </a>
<ul id = "mseu1">
<li> <a href = "pg1.html"> Alles gut, das endet gut </a> </li>
<li> <a href = "pg2.html"> wie es dir gefällt </a> </li>
<li> <a href = "pg3.html"> Love's Labour's Lost </a> </li>
<li> <a href = "pg4.html"> Die Komödie der Fehler </a> </li>
</ul>
</div>
<div>
<a href = "mseu2.html"> Tragödien </a>
<ul id = "mseu2">
<li> <a href = "pg5.html"> anthony & cleopatra </a> </li>
<li> <a href = "pg6.html"> hamlet </a> </li>
<li> <a href = "pg7.html"> romeo & julia </a> </li>
</ul>
</div>
<div>
<a href = "mseu3.html"> histories </a>
<ul id = "mseu3">
<li> <a href = "pg8.html"> Henry IV, Teil1 </a> </li>
<li> <a href = "pg9.html"> henry iv, part2 </a> </li>
</ul>
</div>
</body>
</html>