广厂舞视频播放大全:怎样做asp二级伸缩菜单

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/28 09:00:35
请问下怎样做一个伸缩的asp动态二级分类菜单!
开始是默认菜单全部是打开的,点击大类,他下面的小类会伸缩进去,再点击又会展开!点击小类,小类的商品会查询列出来!
在线等!
开始是默认菜单全部是打开的,点击大类,他下面的小类会伸缩进去,再点击又会展开!点击小类,小类的商品会查询列出来
我要的是这种代码!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>=========无限级目录树=========http://asp2004.net</title>
<meta name="keywords" content="asp2004,树,菜单,无限级">
<meta name="author" content="小灰,quxiaohui_0@163.com">
<link href="style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="function.js"></script>
</head>

<body>
<a href="http://asp2004.net" target="_blank">http://asp2004.net</a>提供最新下载 <a href="index.asp">动态页面</a> <a href="async.asp">异步调用数据演示页面</a> <a href="favorite.asp">网络书签</a> <a href="write.asp">生成代码</a> <a href="demo.htm">静态页面</a><br>
<a href="menu.asp?action=add">添加根节点</a><br>
<%
action=request.QueryString("action")
select case action
case "del"
delmenu request.QueryString("id")
response.Redirect("menu.asp")
case "save"
savemenu
response.Redirect("menu.asp")
case "add"
addmenu
case "edit"
editmenu
case else
menu 0
end select
conn.close
set conn=nothing

'列出所有节点
function menu(id)
set rs=server.CreateObject("adodb.recordset")
sql="select * from menu where id1="&id&" order by url,id"
rs.open sql,conn,1,1
response.write("<table border='0' cellspacing='0' cellpadding='0'>")
i=1
while not rs.eof
ChildCount=conn.execute("select count(*) from menu where id1="&rs("id"))(0)
if ChildCount=0 then
if i=rs.recordcount then
menutype="file1"
else
menutype="file"
end if
menuname="<a href='"&rs("url")&"' target='_blank'>"&rs("menuname")&"</a>"
onmouseup=""
else
if i=rs.recordcount then
menutype="menu3"
listtype="list1"
onmouseup="change1('a"&rs("id")&"','b"&rs("id")&"');"
else
menutype="menu1"
listtype="list"
onmouseup="change2('a"&rs("id")&"','b"&rs("id")&"');"
end if
menuname=rs("menuname")
end if
%>
<tr><td id="b<%= rs("id")%>" class="<%= menutype%>" onMouseUp="<%= onmouseup%>"><%= menuname%> <a href="menu.asp?action=add&id=<%= rs("id")%>"><font color="#0000FF">添加</font></a> | <a href="menu.asp?action=edit&id=<%= rs("id")%>&id1=<%= rs("id1")%>"><font color="#FF0066">修改</font></a> | <a href="menu.asp?action=del&id=<%= rs("id")%>"><font color="#9933FF">删除</font></a></td></tr>
<%
if ChildCount>0 then
%>
<tr id="a<%= rs("id")%>" style="display:none"><td class="<%= listtype%>"><%menu(rs("id"))%></td></tr>
<%
end if
rs.movenext
i=i+1
wend
response.write("</table>")
rs.close
set rs=nothing
end function

'删除节点
function delmenu(id)
set rs=conn.execute("select id from menu where id1="&id)
while not rs.eof
delmenu rs("id")
rs.movenext
wend
conn.execute("delete from menu where id="&id)
end function

'保存节点
function savemenu()
action=request.Form("action")
id=request.Form("id")
id1=request.Form("id1")
menuname=request.Form("menuname")
url=request.Form("url")
select case action
case "edit"
ChildCount=conn.execute("select count(*) from menu where id1="&id)(0)
if ChildCount>0 then url=""
conn.execute("update menu set id1="&id1&",menuname='"&menuname&"',url='"&url&"' where id="&id)
case "add"
conn.execute("update menu set url='' where id="&id1)
conn.execute("insert into menu (id1,menuname,url) values ("&id1&",'"&menuname&"','"&url&"')")
end select
end function

'添加节点
function addmenu()
id=request.QueryString("id")
id1=request.QueryString("id1")
if id="" then id=0
if id1="" then id1=0
action="add"
menuform 0,id,action
end function

'修改节点
function editmenu()
id=request.QueryString("id")
id1=request.QueryString("id1")
action="edit"
menuform id,id1,action
end function

'菜单表单
function menuform(id,id1,action)
if action="edit" then
set rs=conn.execute("select * from menu where id="&id)
menuname=rs("menuname")
url=rs("url")
end if
%>
<form name="form1" method="post" action="menu.asp?action=save">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7%">名称:</td>
<td width="93%"><input name="menuname" type="text" id="menuname" value="<%= menuname%>" size="80"></td>
</tr>
<tr>
<td> </td>
<td>ID:<input name="id" type="text" value="<%= id%>" size="4">ID1:<input name="id1" type="text" value="<%= id1%>" size="4"><input name="action" type="hidden" id="action2" value="<%= action%>"></td>
</tr>
<tr>
<td>URL:</td>
<td><input name="url" type="text" id="url" value="<%= url%>" size="80"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
</table>
</form>
<%
end function
%>
</body>
</html>