NSの下にあるCSDNフォーラムの左リストに似た比較的単純なページ
説明する:
1。1。
データ名:tree.mdb
テーブル名:ツリー
テーブル構造:ID(自己編集)PID(number)コンテンツ(テキスト)リンク(テキスト)
2。
写真:endnode.gif collapsed.gif back.gif(両方ともIMGディレクトリで、自分で変更できます)
3 ..
コード:
<! - #include file = "conn.inc" - >
<html>
<head>
<メタhttp-equiv = "content-type" content = "text/html; charset = gb2312">
<Meta name = "general" content = "microsoft frontpage 4.0">
<title>無制限リスト</title>
<! -
Fason(2003-5-12)
- >
<style>
.node {
フォントサイズ:12px;
パディング:0 0 2 0;
マージン左:10;
高さ:22px;
}
img {
垂直アライイン:中央;
幅:11px;
高さ:11px;
}
{テキスト装置:font-size:black}
.deeptree {
幅:100%;
高さ:100%;
Backgound-color:#f2f2f2;
オーバーフロー:自動;
}
</style>
</head>
<body bgcolor =#f2f2f2>
<NoBr>
<div>
<%
newId = request.querystring( "id")
newid = ""またはcint(newid)<0 thatn newid = 0の場合
is -numeric(newid)の場合
ListTree(Cint(NewID))
ifを終了します
functionlistree(id)
薄暗いrs
dim imgfolder、imgfile
薄暗いリンク、href、painthref
ターゲット、ahref、クリック
ターゲット= "main" '指定されたフレームワーク名
imgfolder = "img/" 'デフォルトパス
rs = conn.execute( "pid = t.idから"ツリーからcount( *)を選択する)を子供としてselece count( *)、(id = "&id&"からtreeからpidを選択しますpid = "&id ))
rs.eofではない場合
parenthref = request.servervariables( "url")& "?id ="&rs( "paint")
id <> 0 respons.write "<div class = 'node' nowrap = true> <a href = '"&parenthref& "' onfocus = 'blur()'> <img src = '&imgfolder&" back .gif 'border = 0> </a> <a href =' "&parenthref&" '>前のカタログ</a> </div> "&vbcrlf
rs.eofではありません
rs( "children")> 0の場合
img = imgfolder "collapset.gif"
href = request.servervariables( "url")& "id ="&rs( "id"))
click = "onclight =" "location.href = '"&href& "'" ""
それ以外
img = imgfolder "endnode.gif"
href = "javascript:void(0)"
ifを終了します
ISNULL(rs( "link")ではない場合
ahref = rs( "link")
それ以外
ahref = "javascript:void(0)"
ターゲット= "_ self"
ifを終了します
link = "<a href = '"&ahref& "'ターゲット= '"&ターゲット& "' title = '"&rs( "content")& "'"&click& ">" "content")& " </a> "</a>
respons.write "<div class = 'node' nowrap = true> <a href = '"& "' onfocus = 'blur()'> <img src = '"&img& "' border = 0> < /a> ""&link& "</div>" "
rs.movenext
ループ
rs.close:rs = Nothingを設定します
ifを終了します
エンド関数
conn.close:set conn = nothing
%>
</div>
</nobr>
</body>
</html>
conn.inc:
<%
dim conn
conn = server.createObject( "adodb.connection")を設定します
conn.open "provider = microsoft.jet.oledb.4.0; data source ="&server.mappath( "tree.mdb")& ";永続セキュリティ情報= false" "
%>
4。テスト:IE6、NS7、Mozillaがテストして通過しました