首页
印 像 新 闻 系 统
网站首页 公告信息 编程实例 PHP函数 摄影无界 全景展示 我的作品 意见专栏
 

树型导行实例

【2005年12月31日 13:10:23】 【阅读:次】 【字体:大 中 小 默认】 【背景:#换背景 #换背景 #换背景 #换背景 #换背景 #换背景 #换背景 默认】

<%
 Dim items(10,2), maxItems
 maxItems = 9
 items(0,0) = "节点 1"
 items(1,0) = "节点 1"
 items(2,0) = "节点 1"
 items(3,0) = "节点 2"
 items(4,0) = "节点 2"
 items(5,0) = "节点 2"
 items(6,0) = "节点 3"
 items(7,0) = "节点 3"
 items(8,0) = "节点 3"
 items(9,0) = "节点 3"

 items(0,1) = "子节点 1.1"
 items(1,1) = "子节点 1.2"
 items(2,1) = "子节点 1.3"
 items(3,1) = "子节点 2.1"
 items(4,1) = "子节点 2.2"
 items(5,1) = "子节点 2.3"
 items(6,1) = "子节点 3.1"
 items(7,1) = "子节点 3.2"
 items(8,1) = "子节点 3.3"
 items(9,1) = "子节点 3.4"
%>

<%
 Dim index,currentItem, openItem
 openItem = Request.QueryString("open")
%>
<HTML>
<HEAD>
 <TITLE>ASP提纲</TITLE>
</HEAD>
<BODY>
 <h2>ASP提纲</h2>
 <UL>
 
 <%
  index = 0
  Do while index <= maxItems
   if items(index,0) <> currentItem then
    If items(index,0) <> openItem then _
     Response.Write("<a href=outline.asp?open=" & _
     Server.URLEncode( items(index,0) ) & ">"  )
     Response.Write( "<LI>" & items(index,0) & "</a>" )
    End If
    
    currentItem = items(index,0)
    If items(index,0) = openItem then
     Response.Write("<UL>")
     Do While index <= maxItems AND items(index,0) = openItem
      Response.Write( "<LI>" & items(index,1) )
      index = index + 1
     Loop
     Response.Write("</UL>")
    End If
   index = index + 1
  Loop
 %>


(『印像空间』 【本文来源:『学习笔记』】 【作者:未知】 【录入:留印】)
限200字,剩余 字
关 键 字:
    
搜索条件: