怎么实现后台添加后 前台就可以实现出 2级下拉单了......
怎么实现后台添加后 前台就可以实现出 2级下拉单了......
正好我在做这样的站点! 给你程序 <STYLE type=text/css>A:link { COLOR: #333333; TEXT-DECORATION: none } A:active { COLOR: #333333; TEXT-DECORATION: none } A:visited { COLOR: #333333; TEXT-DECORATION: none } A:hover { COLOR: #ff6600 } BODY { BACKGROUND-POSITION: center 50%; SCROLLBAR-FACE-COLOR: #c0c0c0; FONT-SIZE: 12px; BACKGROUND-IMAGE: url('Images/bg.gif'); SCROLLBAR-HIGHLIGHT-COLOR: #c0c0c0; SCROLLBAR-SHADOW-COLOR: #c0c0c0; COLOR: #333333; SCROLLBAR-3DLIGHT-COLOR: #e0e0e0; SCROLLBAR-ARROW-COLOR: #333333; SCROLLBAR-TRACK-COLOR: #e0e0e0; FONT-FAMILY: "宋体"; SCROLLBAR-DARKSHADOW-COLOR: #c0c0c0 } TD { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: 宋体 } TD.TableBody1 { BACKGROUND-COLOR: #ffffff } .tableBorder1 { BORDER-RIGHT: 1px; BORDER-TOP: 1px; BORDER-LEFT: 1px; WIDTH: 100%; BORDER-BOTTOM: 1px; BACKGROUND-COLOR: #c5bdc5 } .table { BORDER-RIGHT: #333333 1px solid; BORDER-LEFT: #333333 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff } INPUT { BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc; PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc } </STYLE> <script Language="JavaScript"> var h; var w; var l; var t; var topMar = 3; var leftMar = -10; var space = 2; var isvisible; var MENU_SHADOW_COLOR='#999999'; var global = window.document global.fo_currentMenu = null global.fo_shadows = new Array
function HideMenu() { var mX; var mY; var vDiv; var mDiv; if (isvisible == true) { vDiv = document.all("menuDiv"); mX = window.event.clientX + document.body.scrollLeft; mY = window.event.clientY + document.body.scrollTop; if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){ vDiv.style.visibility = "hidden"; isvisible = false; } } }
function ShowMenu(vMnuCode,tWidth) { vSrc = window.event.srcElement; vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='width:"+tWidth+"' class=tableborder1 onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=tablebody1>" + vMnuCode + "</td></tr></table>";
h = vSrc.offsetHeight; w = vSrc.offsetWidth; l = vSrc.offsetLeft + leftMar+4; t = vSrc.offsetTop + topMar + h + space-2; vParent = vSrc.offsetParent; while (vParent.tagName.toUpperCase() != "BODY") { l += vParent.offsetLeft; t += vParent.offsetTop; vParent = vParent.offsetParent; }
menuDiv.innerHTML = vMnuCode; menuDiv.style.top = t; menuDiv.style.left = l; menuDiv.style.visibility = "visible"; isvisible = true; makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4) }
function makeRectangularDropShadow(el, color, size) { var i; for (i=size; i>0; i--) { var rect = document.createElement('div'); var rs = rect.style rs.position = 'absolute'; rs.left = (el.style.posLeft + i) + 'px'; rs.top = (el.style.posTop + i) + 'px'; rs.width = el.offsetWidth + 'px'; rs.height = el.offsetHeight + 'px'; rs.zIndex = el.style.zIndex - i; rs.backgroundColor = color; var opacity = 1 - i / (i + 1); rs.filter = 'alpha(opacity=' + (100 * opacity) + ')'; el.insertAdjacentElement('afterEnd', rect); global.fo_shadows[global.fo_shadows.length] = rect; } } var About= ' <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">公 司 简 介</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">公 司 文 化</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">组 织 机 构</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">精 神 理 念</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">联 系 我 们</font></a> ' var News= ' <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">企 业 新 闻</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">业 内 资 讯</font></a> ' var Product= ' <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">产 品 展 示</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">产 品 分 类</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">产 品 搜 索</font></a> ' var Job= ' <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">人 才 招 聘</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">人 才 策 略</font></a> ' var sale= ' <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">国 内 市 场</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">国 外 市 场</font></a> ' var server= ' <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">会 员 中 心</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"chakan.asp\"><font color="#000000">留 言 中 心</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">订 单 查 询</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">合 同 下 载</font></a> ' var index= ' <a style=font-size:9pt;line-height:14pt; href=\"index.asp\"><font color="#000000">网 站 首 页</font></a> ' var img= ' <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">企 业 荣 誉</font></a> <br> <a style=font-size:9pt;line-height:14pt; href=\"#\"><font color="#000000">企 业 形 象</font></a> ' </script> <BODY bgColor=#000000 leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" onmousemove="HideMenu()" style="background-image: url('Img/bg0.gif'); background-attachment: fixed"> <div id=menuDiv style='Z-INDEX: 2; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #9cc5f8'></div> <TABLE width="760" border=0 align="center" cellPadding=0 cellSpacing=0 bgcolor="#FFFFFF"> <TBODY> <TR> <TD height=32 background="Img/head_bg1.gif" width="760"> <TABLE cellSpacing=0 cellPadding=0 width="99%" border=0> <TBODY> <TR> <TD width="3%"> </TD> <TD width="97%" valign="bottom"><IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle><a href="index.asp" onMouseOver='ShowMenu(index)'> 首 页</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="dvbbs/index.asp" onMouseOver='ShowMenu(About)'>在线论坛</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#" onMouseOver='ShowMenu(News)'>新闻资讯</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#" onMouseOver='ShowMenu(Product)'>产品展示</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#">下载中心</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#" onMouseOver='ShowMenu(img)'>企业荣誉</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#" onMouseOver="ShowMenu(sale)">营销网络</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#" onMouseOver='ShowMenu(Job)'>人才招聘</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#">信息反馈</a> <IMG height=27 src="Img/head_bg1.gif" width=2 align=absMiddle> <a href="#" onMouseOver='ShowMenu(server)'>客户服务</a></TD> </TR> </TBODY> </TABLE> </TD> </TR> </TBODY> </TABLE>
[此贴子已经被作者于2005-8-5 18:55:57编辑过]