我想用ASP直接做一个下级菜单...不是下拉列表框.....
有人可以帮帮我吗...
[此贴子已经被作者于2007-6-15 20:41:21编辑过]
<!--#include file="conn.asp"-->
<%
Set rs1=server.CreateObject("adodb.recordset")
Sql1="Select * From Connect1"
rs1.open Sql1,conn,1,1
rscount=rs1.recordcount
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
</head>
<body>
<div id="Layer1" style="width:800"></div>
--------------------下面Layer2是放导航栏的地方---------------------
<div id="Layer2">
<table width="150" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<% do while not rs1.eof %>
<td width="<%=800/rscount%>" onmouseover="MM_showHideLayers('Layer<%=rs1("ConID")%>','','show')" onmouseout="MM_showHideLayers('Layer<%=rs1("ConID")%>','','hide')"><%=rs1("ConName")%></td>
<%
rs1.Movenext
Loop
%>
</tr>
</table>
</div>
--------------------下面Layer<%=rs1("CouID")%>是要循环的层---------------------
<% do while not rs1.eof
ConnectID=Clng(rs1("ConID"))%>
<div id="Layer<%=rs1("ConID")%>" style="visibility:hidden">
<%
Set rs2=server.CreateObject("adodb.recordset")
Sql2="Select * From T_Connect Where ConID="&ConnectID&""
rs2.open sql2,conn,1,1
%>
<table width="<%=800/rscount%>">
<tr>
<% do while not rs2.eof %>
<td><%=rs2("T_ConName")%></td>
</tr>
<%
rs2.movenext
Loop
%>
</table>
</div>
<%
rs1.movenext
Loop
%>
</div>
</body>
</html>
[此贴子已经被作者于2007-6-15 0:39:58编辑过]