zoukankan      html  css  js  c++  java
  • 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>")
    %>
  • 相关阅读:
    Jzoj3756 【NOI2014】动物园
    Bzoj5088 HDU 6000 Wash
    Bzoj5088 HDU 6000 Wash
    Jzoj3486 道路改建
    Jzoj3486 道路改建
    合作网络
    工人的请愿书
    划分成回文串
    单向TSP
    旅行
  • 原文地址:https://www.cnblogs.com/zerogo/p/2209396.html
Copyright © 2011-2022 走看看