解读asp中菜单的高级显示

2014 年 12 月 1 日4130

【赛迪网讯】上午花了数个小时终于弄明白了在一些网站上面的“动态”菜单显示,即单击一下可以展开,再单击一下可以收拢。搞了半天,原来如此简单。下面对其进行解释。

<!--#include file="includes/conn.asp"-->



<%



if session("admin")="" then



response.redirect "admin_login.asp"



end if



%>



<html>



<head>



<title>管理导航</title>



<STYLE type=text/css>



BODY {



BACKGROUND: #CCCCCC url('Images/admin/topbg.gif')



repeat-x fixed top; MARGIN: 0px; SCROLLBAR-FACE-COLOR: #C5D5B7;



SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;



SCROLLBAR-SHADOW-COLOR: #ffffff;



SCROLLBAR-3DLIGHT-COLOR: #C5D5B7;



SCROLLBAR-ARROW-COLOR: #006600;



SCROLLBAR-TRACK-COLOR: #999966;



SCROLLBAR-DARKSHADOW-COLOR: #C5D5B7;



font-style:normal; font-variant:normal;



font-weight:normal; font-size:12px; font-family:宋体



}



TABLE { BORDER-RIGHT: 0px; BORDER-TOP: 0px;



BORDER-LEFT: 0px; BORDER-BOTTOM: 0px}



TD { FONT: 12px 宋体}



IMG { BORDER-RIGHT: 0px; BORDER-TOP: 0px;



VERTICAL-ALIGN: bottom; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px}



A { FONT: 12px 宋体; COLOR: #000000; TEXT-DECORATION: none}



A:hover { COLOR: #009900; TEXT-DECORATION: underline}



.sec_menu { BORDER-RIGHT: white 1px solid;



BACKGROUND: #E9EBE2; OVERFLOW: hidden;



BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid}



.menu_title { }



.menu_title SPAN { FONT-WEIGHT: normal;



LEFT: 8px;



COLOR: #333333;



POSITION: relative;



TOP: 2px;



font-size: 14px;



}



.menu_title2 {}



.menu_title2 SPAN {



FONT-WEIGHT: normal;



LEFT: 8px;



COLOR: #333333;



POSITION: relative;



TOP: 2px;



font-size: 14px;



}



</STYLE>



<%



'菜单显示函数,不需要进行更改



%>



<SCRIPT language=javascript1.2>



function showsubmenu(sid)



{



whichEl = eval("submenu" + sid);



if (whichEl.style.display == "none")



{



eval("submenu" + sid + ".style.display=\"\";");



}



else



{



eval("submenu" + sid + ".style.display=\"none\";");



}



}



</SCRIPT>



<meta http-equiv="Content-Type" content="text/html; charset=gb2312">



<base target="rtop">

0 0