<div class="codetitle"> <span><a style="CURSOR: pointer" data="1942" class="copybut" id="copybut1942" onclick="doCopy('code1942')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code1942"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><머리> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <br><title>可折叠弹式菜单</title> <br></head> <br><스타일> <br>body {배경색: #FFF;색상: #000;} <br>div {margin-bottom: 10px;} <br>ul.menu {display: none;list-style-type: none;margin -top: 5px;} <br>a.menuLink {font-size: 16px;font-weight:bold;} <br></style> <br><script type="text/javascript"> <br>window.onload = initAll; <br>function initAll() { <br>var allLinks = document.getElementsByTagName("a"); <br>for (var i=0; i<allLinks.length; i ) { <BR>if (allLinks[i].className.indexOf("menuLink") > -1) { <br>allLinks[i] .onclick = 토글메뉴; <br>} <br>} <br>} <br>functionggleMenu() { <br>var startMenu = this.href.lastIndexOf("/") 1; <br>var stopMenu = this.href.lastIndexOf("."); <br>var thisMenuName = this.href.substring(startMenu,stopMenu); <br>var thisMenu = document.getElementById(thisMenuName).style; <br>if (thisMenu.display == "block") { <br>thisMenu.display = "none"; <br>} <br>else { <br>thisMenu.display = "차단"; <br>} <br>false를 반환합니다. <br>} <br></script> <br><본문> <br><h1>셰익스피어 희곡</h1> <br><div> <br><a href="menu1.html" class="menuLink">Comdeis</a> <br><ul class="menu" id="menu1"> <br><li><a href="pg1.html">끝이 좋으면 다 좋다</a></li> <br><li><a href="pg2.html">원하는대로</a></li> <br><li><a href="pg3.html">사랑의 노동은 실패했습니다</a></li> <br><li><a href="pg4.html">오류의 희극</a></li> <br></ul> <br></div> <br><div> <br><a href="menu2.html" class="menuLink">비극</a> <br><ul class="menu" id="menu2"> <br><li><a href="pg5.html">앤서니와 클레오파트라</a></li> <br><li><a href="pg6.html">햄릿</a></li> <br><li><a href="pg7.html">로미오와 줄리엣</a></li> <br></ul> <br></div> <br><div> <br><a href="menu3.html" class="menuLink">역사</a> <br><ul class="menu" id="menu3"> <br><li><a href="pg8.html">헨리 4세, 1부</a></li> <br><li><a href="pg9.html">헨리 4세, 2부</a></li> <br></ul> <br></div> <br></body> <br></html> <br> </div>