<div class="codetitle"> <span><a style="CURSOR: pointer" data="98893" class="copybut" id="copybut98893" onclick="doCopy('code98893')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code98893"> <br> <br> <br><hrad> <br><metahttp-equiv> <br><title>可折叠的两级菜单</title> <br><styletype> <br><!-- <BR>body{ <BR>background-color:#ffdee0; <BR>} <BR>#navigation { <BR>width:200px; <BR>font-family:Arial; <BR>} <BR>#navigation > ul { <BR>list-style-type:none; <BR>margin:0px; <BR>padding:0px; <BR>} <BR>#navigation > ul >li { <BR>border-bottom:1pxsolid #ED9F9F; <BR>} <BR>#navigation > ul >li > a{ <BR>display:block; <BR>padding:5px5px 5px 0.5em; <BR>text-decoration:none; <BR>border-left:12pxsolid #711515; <BR>border-right:1pxsolid #711515; <BR>} <BR>#navigation > ul >li > a:link, #navigation >ul >li > a:visited{ <BR>background-color:#c11136; <BR>color:#FFFFFF; <BR>} <BR>#navigation > ul >li > a:hover{ <BR>background-color:#990020; <BR>color:#ffff00; <BR>} <BR>.txt{ <BR>background-color:#c11136; <BR>color:#FFFFFF; <BR>padding:5px5px 5px 0.5em; <BR>text-decoration:none; <BR>border-left:12pxsolid #711515; <BR>border-right:1pxsolid #711515; <BR>} <br><br>/* 子菜单的CSS样式 */ <BR>#navigation ul li ul{ <BR>list-style-type:none; <BR>margin:0px; <BR>padding:0px0px 0px 0px; <BR>} <BR>#navigation ul li ulli{ <BR>border-top:1pxsolid #ED9F9F; <BR>} <BR>#navigation ul li ulli a{ <BR>display:block; <BR>padding:3px3px 3px 0.5em; <BR>text-decoration:none; <BR>border-left:28pxsolid #a71f1f; <BR>border-right:1pxsolid #711515; <BR>} <BR>#navigation ul li ulli a:link, #navigationul li ul lia:visited{ <BR>background-color:#e85070; <BR>color:#FFFFFF; <BR>} <BR>#navigation ul li ulli a:hover{ <BR>background-color:#c2425d; <BR>color:#ffff00; <BR>} <BR>#navigation ul li ul.myHide{ /* 隐藏子菜单 */ <BR>display:none; <BR>} <BR>#navigation ul li ul.myShow{ /* 显示子菜单 */ <BR>display:block; <BR>} <BR>--> <br> <br><scriptlanguage> <br>window.onload=function(){ <br>varlistUL=document.getElementById("listUL"); <br>varolist=listUL.childNodes; <br>varoa=0; <br>for(var i = 0; i if(olist[i].tagName=="LI"&&olist[i].getElementsByTagName("ul")[0]){ <br>oa=olist[i]; <br>oa.onclick=change; <br>} <br><br>} <br>functionchange(){ <br>varos=this.getElementsByTagName("ul")[0]; <br>if(os.className=="myHide") <br>os.className="myShow"; <br>else <br>os.className="myHide"; <br>} <br>} <br> <br></scriptlanguage></styletype></metahttp-equiv></hrad> <br> <br><divid> <br><ulid> <br><li> <br><divclass>Home</divclass> </li></ulid></divid> </div> <br> <br><li> <br><divclass>news <br><ulclass> <br><li><ahref>lastest news</ahref></li> <br><li><ahref>all news</ahref></li> <br> <br></ulclass></divclass> </li> <br><li> <br><divclass>sports <br><ulclass> <br><li><ahref>lastest news</ahref></li> <br><li><ahref>all news</ahref></li> <br> <br></ulclass></divclass> </li> <br><li> <br><divclass>weather <br><ulclass> <br><li><ahref>lastest news</ahref></li> <br><li><ahref>all news</ahref></li> <br> <br></ulclass></divclass> </li> <br> <br> <br> <br> <br>