复制代码代码如下:
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en"
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html ؛ charset = utf-8" />
<title> 可折叠弹出式菜单 </title>
</head>
<style>
body {background-color: #fff ؛ color: #000 ؛}
div {margin-bottom: 10px ؛}
ul.menu {display: none ؛ type-style-type: none ؛ hargin-top: 5px ؛}
A.Menulink {font-size: 16px ؛ Font-Weight: Bold ؛}
</style>
<script type = "text/javaScript">
window.onload = initall ؛
وظيفة initall () {
var alllinks = document.getElementSbyTagName ("a") ؛
لـ (var i = 0 ؛ i <alllinks.length ؛ i ++) {
if (alllinks [i] .classname.indexof ("menulink")> -1) {
allinks [i] .onclick = togglemenu ؛
}
}
}
وظيفة togglemenu () {
var startMenu = this.href.lastindexof ("/")+1 ؛
var spopmenu = this.href.lastindexof (".") ؛
var thisMenUname = this.href.substring (StartMenu ، spoopmenu) ؛
var thisMenu = document.getElementById (thisMenUname) .style ؛
if (thismenu.display == "block") {
thismenu.display = "none" ؛
}
آخر {
thismenu.display = "block" ؛
}
العودة كاذبة
}
</script>
<body>
<h1> مسرحيات شكسبير </h1>
<viv>
<a href = "menu1.html"> comdeis </a>
<ul id = "menu1">
<li> <a href = "pg1.html"> كل شيء ينتهي بشكل جيد </a> </li>
<li> <a href = "pg2.html"> كما تحب </a> </li>
<li> <a href = "pg3.html"> Love's Labor's Lost </a> </li>
<li> <a href = "pg4.html"> كوميديا الأخطاء </a> </li>
</ul>
</div>
<viv>
<a href = "menu.html"> المآسي </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>
<viv>
<a href = "menu.html"> التاريخ </a>
<ul id = "menu3">
<li> <a href = "pg8.html"> Henry IV ، part1 </a> </li>
<li> <a href = "pg9.html"> Henry IV ، part2 </a> </li>
</ul>
</div>
</body>
</html>