tab二级导航菜单问题

来源:百度知道 编辑:UC知道 时间:2024/06/10 23:14:20
要求能从数据库中循环调用,鼠标放到(或点击)一级菜单 在其下方显示二级菜单
主要代码如下

下面是从数据库中循环调用一级菜单的代码
<ul>
<%set rsRoot=server.createobject("adodb.recordset")
sql="select * From MenuClass where Depth=0 and ShowOnTop=True order by

RootID"
rsRoot.open sql,conn,1,1
do while not rsRoot.eof
ParentID=rsroot("classID")%>
<li><a href="<%=rsroot("linkurl")%>"><%=rsroot("Classname")%></a></li>
<%RSROOT.MOVENEXT
LOOP
RSROOT=NOTHING
RSROOT.CLOSE%>
</ul>

下面是从数据库中循环调用二级菜单的代码
<ul>
<%set rsRoot1=server.createobject("adodb.recordset")
sql1="select * From MenuClass where Depth=1 and ShowOnTop=True and

ParentID="& ParentID &" order by RootID"
rsRoot1.open sql1,conn,1,1
do while not rsRoot1.eof%>
<li><a href="<%=rsroot1("l

<!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>
<style type="text/css">
<!--
#header {
background-color: #F8F4EF;
height: 200px;
width: 400px;
margin: 0px;
padding: 0px;
border: 1px solid #ECE1D5;
font-family: "宋体";
font-size: 12px;
}
#menu {
margin: 0px;
padding: 0px;
list-style-type: none;
}
#menu li {
display: block;
width: 100px;
text-align: center;
float: left;
margin: 0px;
padding-top: 0.2em;
padding-right: 0px;
padding-b