类似与QQ的好友/黑名单之类的树型菜单
<P>把如下代码复制到<head>与</head>之间</P><P><script><BR>if (!document.getElementById)<BR> document.getElementById = function() { return null; }</P>
<P>function initializeMenu(menuId, actuatorId) {<BR> var menu = document.getElementById(menuId);<BR> var actuator = document.getElementById(actuatorId);</P>
<P> if (menu == null || actuator == null) return;</P>
<P> //if (window.opera) return; // I'm too tired</P>
<P> actuator.parentNode.style.backgroundImage = "url(/images/plus.gif)";<BR> actuator.onclick = function() {<BR> var display = menu.style.display;<BR> this.parentNode.style.backgroundImage =<BR> (display == "block") ? "url(/images/plus.gif)" : "url(/images/minus.gif)";<BR> menu.style.display = (display == "block") ? "none" : "block";</P>
<P> return false;<BR> }<BR>}<BR> window.onload = function() {<BR> initializeMenu("productsMenu", "productsActuator");<BR> initializeMenu("newPhonesMenu", "newPhonesActuator");<BR> initializeMenu("compareMenu", "compareActuator");<BR> }<BR></script><BR><style><BR>body {<BR> font-family: verdana, helvetica, arial, sans-serif;<BR>}</P>
<P>#mainMenu {<BR> background-color: #EEE;<BR> border: 1px solid #CCC;<BR> color: #000;<BR> width: 203px;<BR>}</P>
<P>#menuList {<BR> margin: 0px;<BR> padding: 10px 0px 10px 15px;<BR>}</P>
<P>li.menubar {<BR> background: url(/images/plus.gif) no-repeat 0em 0.3em;<BR> font-size: 12px;<BR> line-height: 1.5em;<BR> list-style: none outside;<BR>}</P>
<P>.menu, .submenu {<BR> display: none;<BR> margin-left: 15px;<BR> padding: 0px;<BR>}</P>
<P>.menu li, .submenu li {<BR> background: url(/images/square.gif) no-repeat 0em 0.3em;<BR> list-style: none outside;<BR>}</P>
<P>a.actuator {<BR> background-color: transparent;<BR> color: #000;<BR> font-size: 12px;<BR> padding-left: 15px;<BR> text-decoration: none;<BR>}</P>
<P>a.actuator:hover {<BR> text-decoration: underline;<BR>}</P>
<P>.menu li a, .submenu li a {<BR> background-color: transparent;<BR> color: #000;<BR> font-size: 12px;<BR> padding-left: 15px;<BR> text-decoration: none;<BR>}</P>
<P>.menu li a:hover, submenu li a:hover {<BR> /*border-bottom: 1px dashed #000;*/<BR> text-decoration: underline;<BR>}</P>
<P>span.key {<BR> text-decoration: underline;<BR>}<BR></style></P>
<P>把如下代码复制到<body>与</body>之间</P>
<P><div id="mainMenu"><BR> <ul id="menuList"><BR> <li class="menubar"><BR> <a href="#" id="productsActuator" class="actuator">网页特效库</a><BR> <ul id="productsMenu" class="menu"><BR> <li><BR> <a href="#" id="newPhonesActuator" class="actuator">栏目导航</a><BR> <ul id="newPhonesMenu" class="submenu"><BR> <li><a href="<A href="http://www.butong.net/background/index.htm">http://www.butong.net/background/index.htm</A>" target="_balcn">背景按钮特效</a></li><BR> <li><a href="<A href="http://www.butong.net/moban/index.htm">http://www.butong.net/moban/index.htm</A>" target="_balcn">网页模板</a></li><BR> <li><a href="<A href="http://www.butong.net/navigation/index.htm">http://www.butong.net/navigation/index.htm</A>" target="_balcn">导航菜单特效</a></li><BR> <li><a href="<A href="http://www.butong.net/img/index.htm">http://www.butong.net/img/index.htm</A>" target="_balcn">图像特效</a></li><BR> </ul><BR> </li><BR> <li><BR> <a href="#" id="compareActuator" class="actuator">栏目导航</a><BR> <ul id="compareMenu" class="submenu"><BR> <li><a href="<A href="http://www.butong.net/text/index.htm">http://www.butong.net/text/index.htm</A>" target="_balcn">文本特效</a></li><BR> <li><a href="<A href="http://www.butong.net/time/index.htm">http://www.butong.net/time/index.htm</A>" target="_balcn">时间日期特效</a></li><BR> <li><a href="<A href="http://www.butong.net/state/index.htm">http://www.butong.net/state/index.htm</A>" target="_balcn">状态栏特效</a></li><BR> <li><a href="<A href="http://www.butong.net/other/index.htm">http://www.butong.net/other/index.htm</A>" target="_balcn">另类网页特效</a></li><BR> </ul><BR> </li><BR> </ul><BR> </li><BR> </ul><BR> </div></P>
页:
[1]