三级动态树形菜单

三级树形菜单,之前有发过一个那个和这个还是有区别的.表结构仍然是我一直发的那样的.注意,不能打开二级类

就是说只能打开大类和三级类.当有类别无三级类时候,就不适用了.

< ! -- #includefile = " inc/conn.asp " -->




< TABLEwidth = 190 >

< TR >
< TDwidth = " 100% " >



< %
set rsBigClass1 = server.CreateObject( " adodb.recordset " )
rsBigClass1.open
" Select*FromBigClass " ,conn, 1 , 1
i
= 100

do while not rsBigClass1.eof
i
= i + 100
%
>

< TABLEid = LeftMenu_ < % = i% > _offcellSpacing = 0 cellPadding = 0
width
= " 100% " >
< TBODY >
< TRclass = tree_button_title
onmouseover
= " this.className='tree_button_title_on'; "
onclick
= " document.getElementById('LeftMenu_<%=i%>_on').style.display=(document.getElementById('LeftMenu_<%=i%>_on').style.display=='none')?'':'none';document.getElementById('LeftMenu_<%=i%>_off').style.display=(document.getElementById('LeftMenu_<%=i%>_off').style.display=='none')?'':'none' "
onmouseout
= " this.className='tree_button_title' " >
< TD >< B >< A
href
= " Product.asp?bigclassname=<%=rsBigClass1( " BigClassName " )%> "
>< % = rsbigclass1( " bigclassname " )% ></ A ></ B >& nbsp; & nbsp; </ TD >
< TDalign = right >< IMG
src
= " newegg_menu/plus.gif " ></ TD ></ TR ></ TBODY ></ TABLE >



< TABLEid = LeftMenu_ < % = i% > _onstyle = " DISPLAY:none " cellSpacing = 0
cellPadding
= 0 width = " 100% " > < TBODY >

< TR >
< TD >



< TABLEcellSpacing = 0 cellPadding = 0 width = " 100% " >
< TBODY >
< TRclass = tree_button_title
onmouseover
= " this.className='tree_button_title_on'; "
onclick
= " document.getElementById('LeftMenu_<%=i%>_on').style.display=(document.getElementById('LeftMenu_<%=i%>_on').style.display=='none')?'':'none';document.getElementById('LeftMenu_<%=i%>_off').style.display=(document.getElementById('LeftMenu_<%=i%>_off').style.display=='none')?'':'none' "
onmouseout
= " this.className='tree_button_title' " >
< TD >< B >< A
href
= " Product.asp?bigclassname=<%=rsBigClass1( " BigClassName " )%> "
>< % = rsbigclass1( " bigclassname " )% ></ A ></ B >& nbsp; & nbsp; </ TD >
< TDalign = right >< IMG
src
= " newegg_menu/minus.gif " ></ TD ></ TR ></ TBODY ></ TABLE >
< %
set rsSmallClass1 = server.CreateObject( " adodb.recordset " )
rsSmallClass1.open
" Select*FromSmallClassWhereBigClassName=' " & rsBigClass1( " BigClassName " ) & " ' " ,conn, 1 , 1
if not (rsSmallClass1.bof and rsSmallClass1.eof) then
j
= 33
do while not rsSmallClass1.eof
j
= j + 100

%
>
< ! -- 三级类关闭时候 -->
< TABLEid = LeftMenu_ < % = i% > _ < % = j% > _offcellSpacing = 0
cellPadding
= 0 width = " 100% " border = 0 >
< TBODY >
< TR >
< TDclass = tree_button
onmouseover
= " this.className='tree_button_on'; "
onclick
= " document.getElementById('LeftMenu_<%=i%>_<%=j%>_on').style.display=(document.getElementById('LeftMenu_<%=i%>_<%=j%>_on').style.display=='none')?'':'none';document.getElementById('LeftMenu_<%=i%>_<%=j%>_off').style.display=(document.getElementById('LeftMenu_<%=i%>_<%=j%>_off').style.display=='none')?'':'none' "
onmouseout
= " this.className='tree_button' " >< IMG
height
= 6
src
= " newegg_menu/arrow_right.gif "
width
= 5 border = 0 >& nbsp; < FONT
size
=+ 0 >< % = rsSmallClass1( " SmallClassName " )% ></ FONT >& nbsp; & nbsp; </ TD ></ TR ></ TBODY ></ TABLE >


< ! -- 三级类关闭时候 -->





< ! -- 三级类展开时候 -->
< TABLEid = LeftMenu_ < % = i% > _ < % = j% > _onstyle = " DISPLAY:none "
cellSpacing
= 0 cellPadding = 0 width = " 100% " border = 0 >
< TBODY >
< TR >
< TD >
< TABLEcellSpacing = 0 cellPadding = 0 width = " 100% "
border
= 0 >
< TBODY >
< TR >

< TDclass = tree_button
onmouseover
= " this.className='tree_button_on'; "
onclick
= " document.getElementById('LeftMenu_<%=i%>_<%=j%>_on').style.display=(document.getElementById('LeftMenu_<%=i%>_<%=j%>_on').style.display=='none')?'':'none';document.getElementById('LeftMenu_<%=i%>_<%=j%>_off').style.display=(document.getElementById('LeftMenu_<%=i%>_<%=j%>_off').style.display=='none')?'':'none' "
onmouseout
= " this.className='tree_button' " >< IMG
height
= 6
src
= " newegg_menu/arrow_down.gif "
width
= 5 border = 0 >& nbsp; < FONT
size
=+ 0 >< % = rsSmallClass1( " SmallClassName " )% ></ FONT >& nbsp; & nbsp; </ TD ></ TR ></ TBODY ></ TABLE >
< ! -- 三级类 -->
< TABLEcellSpacing = 0 cellPadding = 0 width = " 100% "
border
= 0 >
< TBODY >
< TR >
< TDclass = tree_button_content >
< %sql3 = " select*fromminclasswhereBigClassName=' " & rsBigClass1( " BigClassName " ) & " 'andsmallclassname=' " & rsSmallClass1( " SmallClassName " ) & " ' "
set rs3 = Server.CreateObject( " adodb.recordset " )
rs3.Opensql3,conn,
1 , 1
do while not rs3.eof% >

< DIVclass = tree_button_list >< A
href
= " Product.asp?bigclassname=<%=rsBigClass1( " BigClassName " )%>&smallclassname=<%=rsSmallClass1( " SmallClassName " )%>&minclassname=<%=rs3( " minclassname " )%> " >< % = rs3( " minclassname " )% ></ A ></ DIV >
< %
rs3.movenext
loop
%
>

</ TD >
</ TR >
</ TBODY >
</ TABLE >
< ! -- 三级类 -->
</ TD ></ TR ></ TBODY >
</ TABLE >
< ! -- 三级类展开时候 -->
< %rsSmallClass1.movenext
loop
end if
rsSmallClass1.close
set rsSmallClass1 = nothing % >
</ TD >
</ TR >
</ TBODY >
</ TABLE >




< %
rsBigClass1.movenext

loop
rsbigclass1.close
set rsbigclass1 = nothing
%
>
</ TD ></ TR >

</ TABLE >
http://www.corange.cn/archives/2007/03/24.html

你可能感兴趣的:(J#,asp)