`
webcode
  • 浏览: 5929458 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

三级动态树形菜单

阅读更多

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

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

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




<TABLEwidth=190>

<TR>
<TDwidth="100%">



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

dowhilenotrsBigClass1.eof
i
=i+100
%
>

<TABLEid=LeftMenu_<%=i%>_offcellSpacing=0cellPadding=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
=0width="100%"><TBODY>

<TR>
<TD>



<TABLEcellSpacing=0cellPadding=0width="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>
<%
setrsSmallClass1=server.CreateObject("adodb.recordset")
rsSmallClass1.open
"Select*FromSmallClassWhereBigClassName='"&rsBigClass1("BigClassName")&"'",conn,1,1
ifnot(rsSmallClass1.bofandrsSmallClass1.eof)then
j
=33
dowhilenotrsSmallClass1.eof
j
=j+100

%
>
<!--三级类关闭时候-->
<TABLEid=LeftMenu_<%=i%>_<%=j%>_offcellSpacing=0
cellPadding
=0width="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
=5border=0>&nbsp;<FONT
size
=+0><%=rsSmallClass1("SmallClassName")%></FONT>&nbsp;&nbsp;</TD></TR></TBODY></TABLE>


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





<!--三级类展开时候-->
<TABLEid=LeftMenu_<%=i%>_<%=j%>_onstyle="DISPLAY:none"
cellSpacing
=0cellPadding=0width="100%"border=0>
<TBODY>
<TR>
<TD>
<TABLEcellSpacing=0cellPadding=0width="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
=5border=0>&nbsp;<FONT
size
=+0><%=rsSmallClass1("SmallClassName")%></FONT>&nbsp;&nbsp;</TD></TR></TBODY></TABLE>
<!--三级类-->
<TABLEcellSpacing=0cellPadding=0width="100%"
border
=0>
<TBODY>
<TR>
<TDclass=tree_button_content>
<%sql3="select*fromminclasswhereBigClassName='"&rsBigClass1("BigClassName")&"'andsmallclassname='"&rsSmallClass1("SmallClassName")&"'"
setrs3=Server.CreateObject("adodb.recordset")
rs3.Opensql3,conn,
1,1
dowhilenotrs3.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
endif
rsSmallClass1.close
setrsSmallClass1=nothing%>
</TD>
</TR>
</TBODY>
</TABLE>




<%
rsBigClass1.movenext

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

</TABLE>
http://www.corange.cn/archives/2007/03/24.html
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics