大家好 这个是我第一次分享 是一个关于控制面板左侧导航栏 帝国所说的功能菜单 是我从网上特效资源 改版而来的 大家可以试一试 看以下代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> [!--temp.xiaochu--] <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>控制面板[!--temp.biaoti--]</title> <link href="[!--news.url--]skin/default/css/style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .Al { WIDTH: 176px; border-right-width: 1px; border-right-style: solid; border-right-color: #335EA8; border-top-width: 1px; border-top-style: solid; border-top-color: #335EA8; } .Al_1 { PADDING-RIGHT: 8px; PADDING-LEFT: 8px; BACKGROUND: #c5ebfe; PADDING-BOTTOM: 0px; FONT: bold 14px/24px arial; WIDTH: 168px; COLOR: #333; PADDING-TOP: 0px } .Al_2 { WIDTH: 165px; padding: 6px; } .Al_2 span { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: url(http://icon.zol.com.cn/my/images/1/ln.gif) repeat-x 0px 100%; PADDING-BOTTOM: 8px; FONT: 14px/22px arial; PADDING-TOP: 8px; clear: both; } .Al_2 DT { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FLOAT: left; PADDING-BOTTOM: 0px; FONT: bold 14px/26px simsun; WIDTH: 140px; PADDING-TOP: 0px; margin: 0px; clear: both; } .Al_2 span IMG { FLOAT: left; margin-top: 4px; margin-right: 4px; margin-bottom: 0px; margin-left: 0px; } .Al_2 span A { PADDING-RIGHT: 18px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; background-image: url(http://bbs.itkeji.net/images/admincp/desc.gif); background-repeat: no-repeat; background-position: right center; font-weight: bold; } .Al_2 span A:hover { COLOR: #333; TEXT-DECORATION: none } .Al_2 span A.act { BACKGROUND-IMAGE: url(http://bbs.itkeji.net/images/admincp/add.gif); background-repeat: no-repeat; background-position: right center; } .Al_2 div { PADDING-RIGHT: 0px; DISPLAY: none; PADDING-BOTTOM: 0px; WIDTH: 110px; PADDING-TOP: 0px; clear: both; text-align: left; padding-left: 37px; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: #CCCCCC; } .Al_2 div A { padding: 2px; font-size: 14px; line-height: 22px; } .Al_2 div A:hover { COLOR: #c00 } --> </style> <script type="text/javascript" src="[!--news.url--]e/data/js/ajax.js"></script> <SCRIPT language=JavaScript type=text/javascript> function switchShow(id){ var tObj = document.getElementById("div_"+id); var iObj = document.getElementById("a_"+id); if(tObj) tObj.style.display=(tObj.style.display=='none')?"block":"none"; if(iObj&&tObj)iObj.className=(tObj.style.display=='none')?"act":""; //alert(tObj.style.display); } function set(obj){ document.getElementById(obj).style.display='block'; document.getElementById(obj+'1').style.display='none'; } function cancel(obj){ document.getElementById(obj).style.display='none'; document.getElementById(obj+'1').style.display='block'; } </SCRIPT> </head> <body class="listpage"> [!--temp.dtheader--] <table width="960" border="0" align="center" cellpadding="0" cellspacing="0"> <tr valign="top"> <td class="list_content"><table style="margin-top:8px; text-align:left;" width="100%" border="0" cellspacing="0" cellpadding="0" class="position"> <tr> <td>现在的位置:[!--newsnav--] </td> </tr> </table> <table width="960" border="0" cellspacing="0" cellpadding="0" class="box"> <tr> <td width="177" valign="top"><div class="Al"> <div class="Al_1">控制面板</div> <div class="Al_2"> <span><img src="http://pop.itkeji.net/images/base/toolbar_icon_post.gif" width="16" height="16" /><A style="PADDING-RIGHT: 30px; BACKGROUND-IMAGE: url(http://www.itkeji.net/img/news_fabu.gif)" href="[!--news.url--]e/DoInfo/">发布文章</A></span><br> <span><img src="http://bbs.itkeji.net/images/default/tradesmall.gif" width="16" height="16" /><A href="http://shop.itkeji.net" target="_parent" style="PADDING-RIGHT: 30px; BACKGROUND-IMAGE: url(http://www.itkeji.net/img/news_fabu.gif)">我要购物</A></span> <span><img src="http://bbs.itkeji.net/images/default/digest_3.gif" width="16" height="13" /><A id=a_1 onclick="javascript:switchShow('1')" href="javascript:void(0);" target=_self>帐号状态</A></span> <div id=div_1 style="DISPLAY: block"><A href="[!--news.url--]e/member/my/">前台状态</A><BR> <A href="http://bbs.itkeji.net/space.php?uid=<?=$user[userid]?>" target="_blank">论坛状态</A> </div> </div> </div></td> <td width="783" valign="top">[!--empirenews.template--]</td> </tr> </table></td> </tr> </table> [!--temp.footer--] </body> </html> 需要重复的就是绿色与红色部分 一般是红色部分 这样的菜单更有利于充分利用空间 你可以直接改动结合你的论坛等资料
就来说说怎么改动JS对应的ID吧 相信老鸟们一看就知道怎么改 对于新手我就在说一下 鄙视懒惰的人
<span><img src="http://bbs.itkeji.net/images/default/digest_3.gif" width="16" height="13" /><A id=a_1 onclick="javascript:switchShow('1')" href="javascript:void(0);" target=_self>帐号状态</A></span> <div id=div_1 style="DISPLAY: block"><A href="[!--news.url--]e/member/my/">前台状态</A><BR> <A href="http://bbs.itkeji.net/space.php?uid=<?=$user[userid]?>" target="_blank">论坛状态</A> </div>
其实很简单的 红色的IMG就不用多说了!这个不会改就没得话说了啊
接下来就是红色部分 在超链接标签中的ID的 编码是与实现效果中的 编码相对应的 比如连接中的 id="a_1" 那么行为动作对应的也要是编码1 效果中对应的也是1
在增加第二项的时候 复制整段代码 然后 那个ID编号改为不一样的就是了 其他的一定要改哦 呵呵呵 简单吧 有时间大家以后多多关照本站 IT科技网 IT科技论坛 效果图附上
上传以下图片:

|