左侧的隐藏菜单,点击后显示下拉分级菜单的内容
<html><br /> <head><br /> <title>web reference</title><br /> <script language="JavaScript1.2" type="text/javascript"><br /> var maxmnus = 5<br /> function opTab(){<br /> var mnu = document.getElementById("menubar")<br /> var arrdiv = document.getElementById("arrow")<br /> var arrtxt = document.getElementById("arr")<br /> if((mnu.style.display != "block") || (mnu.style.display == "")){<br /> mnu.style.display = "block"<br /> arrdiv.style.pixelLeft = mnu.style.width.substring(0 , mnu.style.width.length - 2)<br /> arrtxt.innerText = "3";<br /> } else {<br /> mnu.style.display = "none"<br /> arrtxt.innerText = "4";<br /> arrdiv.style.pixelLeft = 0;<br /> }<br /> event.cancelBubble = true;<br /> }<br /> function toggleMenu(el){<br /> for(var i = 0;i < maxmnus;i++) document.getElementById(document.getElementById("c" + i).menu).style.display = "none";<br /> if(el.status == "closed"){<br /> el.status = "open"<br /> document.getElementById(el.menu).style.display = "block";<br /> } else {<br /> el.status = "closed"<br /> }<br /> }<br /> function toggleSub(e){<br /> el = document.getElementById(e)<br /> if(el.status == "closed"){<br /> el.style.display = "block";<br /> el.status = "open"<br /> } else {<br /> el.style.display = "none";<br /> el.status = "closed"<br /> } <br /> event.cancelBubble = true;<br /> }<br /> </script><br /> <style type="text/css"><br /> #menubar{<br />position:absolute;top:0px;left:0px;display:none;font-family:Verdana,Helvetica,Arial;font-weight:700;font-size:10px;cursor:hand;z-index:5;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#2644b2', endColorstr='#e7e8f1');}<br /> .indicator{<br />color:#b24426;font-family:Webdings;font-weight:bold;font-size:10px;}<br /> .r1{<br />position:relative;top:10px;left:5px;width:213px;color:#e7e8f1;border-left:#e7e8f1 2px outset;border-top:#e7e8f1 2px outset;border-right:#e7e8f1 2px outset;border-bottom:#e7e8f1 2px outset;padding-left:5px;padding-top:1px;adding-right:5px;padding-bottom:1px;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#2644b2', endColorstr='#e7e8f1');}<br /> .submenu1{<br />position:relative;top:0px;left:0px;height:95%;width:100%;border-left:#e0f8e3 2px inset;border-top:#e0f8e3 2px inset;border-right:#e0f8e3 2px inset;border-bottom:#e0f8e3 2px inset;padding-left:3px;padding-top:3px;padding-right:3px;padding-bottom:3px;display:none;color:#2644b2;font-family:Verdana,Helvetica,Arial;font-weight:700;font-size:10px;background-color:#cff1d4;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#bec1e4', endColorstr='#e7e8f1');}<br /> .submenu2{<br />position:relative;top:0px;left:0px;width:90%;border-left:#e0f8e3 3px groove;border-top:#e0f8e3 3px groove;border-right:#e0f8e3 3px groove;border-bottom:#e0f8e3 3px groove;padding-left:3px;padding-top:3px;padding-right:3px;padding-bottom:3px;margin-top:4px;display:none;background-color:#cff1d4;color:#2644b2;font-family:Verdana,Helvetica,Arial;font-weight:700;font-size:10px;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#bec1e4', endColorstr='#e7e8f1');}<br /> .pulltab{<br />position:absolute;top:0px;left:0px;height:100%;width:20px;padding-left:2px;cursor:hand;color:#2644b2;font-family:Webdings;font-weight:bold;font-size:10px;z-index:5;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#e7e8f1', endColorstr='#2644b2');}<br /> .inner{<br />height:100%;width:100%;}<br /> .mtab{<br />position:relative;top:0px;<br /> .btninner{<br />height:100%;width:100%;}<br /> .fr{<br />position:absolute;top:0px;left:35px;}<br /> </style><br /> </head><br /> <body scroll="no"><br /> <div id="menubar" style="; HEIGHT: expression(document.body.offsetHeight); WIDTH: 223px"><br /> <div id="c0" class="r1" onClick="toggleMenu(this)" status="closed" menu="m0"><br /> <div id="cbtn" class="btninner">Behaviors</div><br /> <div class="mtab"><br /> <table id="m0" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0"><br /> <tr><td onClick="opTab();"><a href="<a target=_blank href='http://www.sq01.cn">DHTML'>http://www.sq01.cn">DHTML</a> Behaviours</a></td></tr><br /> <tr><td onClick="toggleSub('m0s0');">ViewLink Overview<span class="indicator">6</span><br /> <table id="m0s0" class="submenu2" align="center" border="0" cellspacing="0" cellpadding="0" status="closed"><br /> <tr><td onClick="opTab();">ViewLink CSS Inheritance</td></tr><br /> </table><br /> </table><br /> </div><br /> </div><br /> <div id="c1" class="r1" onClick="toggleMenu(this)" status="closed" menu="m1"><br /> <div id="cbtn" class="btninner">CSS</div><br /> <div><br /> <table id="m1" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0"><br /> <tr><td onClick="opTab();">css</td></tr><br /> <tr><td onClick="opTab();">css</td></tr><br /> </table><br /> </div><br /> </div><br /> <div id="c2" class="r1" onClick="toggleMenu(this)" status="closed" menu="m2"><br /> <div id="cbtn" class="btninner">DHTML</div><br /> <div><br /> <table id="m2" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0"><br /> <tr><td>DHTML 1</td></tr><br /> <tr><td>DHTML 2</td></tr><br /> </table><br /> </div><br /> </div><br /> <div id="c3" class="r1" onClick="toggleMenu(this)" status="closed" menu="m3"><br /> <div id="cbtn" class="btninner">DOM</div><br /> <div><br /> <table id="m3" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0"><br /> <tr><td>DOM 1</td></tr><br /> <tr><td>DOM 2</td></tr><br /> </table><br /> </div><br /> </div><br /> <div id="c4" class="r1" onClick="toggleMenu(this)" status="closed" menu="m4"><br /> <div id="cbtn" class="btninner">HTML</div><br /> <div><br /> <table id="m4" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0"><br /> <tr><td>HTML 1</td></tr><br /> <tr><td>HTML 2</td></tr><br /> </table><br /> </div><br /> </div><br /> </div><br /> <div id="arrow" class="pulltab" onClick="opTab()"><table class="inner"><tr><td id="arr" valign="middle">4</td></tr></table></div><br /> <div id="fr" name="fr" class="fr"><br /> <h2>左侧的变化菜单</h2><br /> </div><br /> </body><br /> </html><p>[此帖子已被 灰儿 在 2007-12-28 15:51:47 编辑过]
页:
[1]