复制代码代码如下:
<! Doctype html public "- // w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<adal>
<meta http-equiv = "contenu-type" contenu = "text / html; charset = utf-8" />
<Title> 可折叠弹出式菜单 </TITAL>
</ head>
<style>
corps {fond de fond: #fff; couleur: # 000;}
div {marge-fond: 10px;}
ul.menu {affichage: aucun; style list-style: aucun; marge: 5px;}
A.Menulink {Font-Size: 16px; Font-Weight: Bold;}
</ style>
<script type = "text / javascript">
window.onload = initall;
fonction initall () {
var allLinks = document.getElementsByTagName ("a");
pour (var i = 0; i <alllinks.length; i ++) {
if (allLinks [i] .classname.indexof ("menulink")> -1) {
AllLinks [i] .OnClick = toggleMenu;
}
}
}
fonction togglemenu () {
var startMenu = this.href.lastIndexof ("/") + 1;
var stop stopMenu = this.href.LastIndexof (".");
var thisMenuname = this.href.substring (startMenu, stopMenu);
var thisMenu = document.getElementById (thisMenuname) .Style;
if (thismenu.display == "block") {
thisMenu.display = "Aucun";
}
autre {
thisMenu.display = "block";
}
retourne false;
}
</cript>
<body>
<h1> les pièces de Shakespeare </h1>
<div>
<a href = "menu1.html"> comdeis </a>
<ul id = "menu1">
<li> <a href = "pg1.html"> Tout est bien qui se termine bien </a> </li>
<li> <a href = "pg2.html"> comme vous l'aimez </a> </li>
<li> <a href = "pg3.html"> LOBAL'S LOBAL'S LOST </a> </li>
<li> <a href = "pg4.html"> La comédie des erreurs </a> </li>
</ul>
</div>
<div>
<a href = "menu2.html"> tragédies </a>
<ul id = "menu2">
<li> <a href = "pg5.html"> Anthony & Cléopâtre </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"> Histories </a>
<ul id = "menu3">
<li> <a href = "pg8.html"> Henry IV, part1 </a> </li>
<li> <a href = "pg9.html"> Henry IV, partie2 </a> </li>
</ul>
</div>
</docy>
</html>