会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
ajuanabc
博客园
首页
新随笔
联系
订阅
管理
asp动态树菜单集合(2/3)
相关数据库结构请查看
http://blog.csdn.net/piperzero/archive/2006/07/25/977083.aspx
二级树
如下
同时展开一个
<!--
以下是可以同时只能打开一个子目录的二级数
-->
<!--
#include file="inc/conn.asp"
-->
<%
...
set
rs
=
conn.execute(
"
select * from bigclass
"
)
if
rs.recordcount
=
0
then
Response.Write(
"
暂无
"
)
else
i
=
0
while
not
rs.eof
Response.Write(
"
┬ <a href=""javascript:menu
"
&
i
&
"
func()""><b>
"
&
rs(
"
bigclassname
"
)
&
"
</b></a><br>
"
&
CHR
(
10
))
ljh_temp
=
ljh_temp
&
"
menu
"
&
i
&
"
.style.display=""none"";
"
&
CHR
(
10
)
ljh_temp2
=
ljh_temp2
&
"
function menu
"
&
i
&
"
func()
"
&
CHR
(
10
)
&
"
{
"
&
CHR
(
10
)
&
"
if(menu
"
&
i
&
"
.style.display==""none"")
"
&
CHR
(
10
)
&
"
{
"
&
CHR
(
10
)
&
"
startmenu();
"
&
CHR
(
10
)
&
"
menu
"
&
i
&
"
.style.display=""block"";
"
&
CHR
(
10
)
&
"
}
"
&
CHR
(
10
)
&
"
else
"
&
CHR
(
10
)
&
"
{
"
&
CHR
(
10
)
&
"
startmenu();
"
&
CHR
(
10
)
&
"
}
"
&
CHR
(
10
)
&
"
}
"
&
CHR
(
10
)
&
""
set
rs2
=
conn.execute(
"
select * from smallclass where bigclassname='
"
&
rs(
"
bigclassname
"
)
&
"
'
"
)
'
因为是字符型,所以用到了''
if
rs2.recordcount
=
0
then
Response.Write(
"
<div id=""menu
"
&
i
&
"
"" style=""DISPLAY: none"">├ 暂无</div>
"
&
CHR
(
10
))
else
Response.Write(
"
<div id=""menu
"
&
i
&
"
"" style=""DISPLAY: none"">
"
&
CHR
(
10
))
while
not
rs2.eof
Response.Write(
"
├ <a href=""product.asp?bigclassname=
"
&
rs(
"
bigclassname
"
)
&
"
&smallclassname=
"
&
rs2(
"
smallclassname
"
)
&
"
"">
"
&
rs2(
"
smallclassname
"
)
&
"
</a><br>
"
&
CHR
(
10
))
rs2.movenext
wend
Response.Write(
"
</div>
"
&
CHR
(
10
))
end
if
rs2.close
set
rs2
=
nothing
i
=
i
+
1
rs.movenext
wend
end
if
rs.close
set
rs
=
nothing
Response.Write(
"
<script language=""javascript"" type=""text/javascript"">
"
&
CHR
(
10
))
Response.Write(
"
function startmenu()
"
&
CHR
(
10
)
&
"
{
"
&
CHR
(
10
)
&
ljh_temp
&
"
}
"
&
CHR
(
10
))
Response.Write(ljh_temp2)
Response.Write(
"
</script>
"
)
%>
posted @
2006-07-26 00:08
ajuanabc
阅读(
140
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告