• 三级动态树形菜单


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

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

     

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




          
    <TABLE width=190 >
           
                  
    <TR>
                    
    <TD width="100%">
                      
                    
                    
                     
    <%
            
    set rsBigClass1=server.CreateObject("adodb.recordset")
    rsBigClass1.open 
    "Select * From BigClass",conn,1,1
        i
    =100

        
    do while not rsBigClass1.eof
        i
    =i+100
    %
    >
                    
                      
    <TABLE id=LeftMenu_<%=i%>_off cellSpacing=0 cellPadding=0  
                      width
    ="100%">
                        
    <TBODY>
                        
    <TR class=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><
                            href
    ="Product.asp?bigclassname=<%=rsBigClass1("BigClassName")%>" 
                            
    ><%=rsbigclass1("bigclassname")%></A></B>&nbsp;&nbsp;</TD>
                          
    <TD align=right><IMG 
                            src
    ="newegg_menu/plus.gif"></TD></TR></TBODY></TABLE>
                            
                    
                            
                      
    <TABLE id=LeftMenu_<%=i%>_on style="DISPLAY: none" cellSpacing=0 
                      cellPadding
    =0 width="100%">                    <TBODY>
                        
                        
    <TR>
                          
    <TD>
                          
                          
                          
                            
    <TABLE cellSpacing=0 cellPadding=0 width="100%">
                              
    <TBODY>
                              
    <TR class=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><
                                  href
    ="Product.asp?bigclassname=<%=rsBigClass1("BigClassName")%>" 
                                  
    ><%=rsbigclass1("bigclassname")%></A></B>&nbsp;&nbsp;</TD>
                                
    <TD align=right><IMG 
                                  src
    ="newegg_menu/minus.gif"></TD></TR></TBODY></TABLE>
                        
    <%
          
    set rsSmallClass1=server.CreateObject("adodb.recordset")
          rsSmallClass1.open 
    "Select * From SmallClass Where BigClassName='" & rsBigClass1("BigClassName"& "'",conn,1,1
          
    if not(rsSmallClass1.bof and rsSmallClass1.eof) then
           j
    =33
            
    do while not rsSmallClass1.eof
            j
    =j+100

        %
    >        
                         
    <!--三级类关闭时候-->
                           
    <TABLE id=LeftMenu_<%=i%>_<%=j%>_off cellSpacing=0 
                            cellPadding
    =0 width="100%" border=0>
                              
    <TBODY>
                              
    <TR>
                                
    <TD class=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>
                
                                  
                        
    <!--三级类关闭时候-->
                        
                        
                        
                        
                            
                            
    <!--三级类展开时候-->     
                            
    <TABLE id=LeftMenu_<%=i%>_<%=j%>_on style="DISPLAY: none" 
                            cellSpacing
    =0 cellPadding=0 width="100%" border=0>
                                
    <TBODY>
                                
    <TR>
                                
    <TD>
                                  
    <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                                  border
    =0>
                                    
    <TBODY>
                                    
    <TR>

                                    
    <TD class=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>
                                              
    <!--三级类-->
                                              
    <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                                                  border
    =0>
                                                
    <TBODY>
                                                   
    <TR>
                                                
    <TD class=tree_button_content>
                                                
    <%sql3="select * from minclass where BigClassName='" & rsBigClass1("BigClassName"& "' and smallclassname='" & rsSmallClass1("SmallClassName"& "'"
           
    set rs3=Server.CreateObject("adodb.recordset")
           rs3.Open sql3,conn,
    1,1 
        
    do while not rs3.eof%>
                                    
                                    
    <DIV class=tree_button_list><
                                    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
  • 相关阅读:
    Vijos P1597 2的幂次方【进制+递归】
    NUC1100 Biorhythms【中国剩余定理】
    HDU1370 Biorhythms【中国剩余定理】
    NUC1090 Goldbach's Conjecture【哥德巴赫猜想 】
    NUC1305 哥德巴赫猜想
    剑指Offer——最小的K个数
    剑指Offer——数组中出现次数超过一半的数字
    剑指Offer——字符串的排列
    剑指Offer——二叉搜索树与双向链表
    剑指Offer——复杂链表的复制
  • 原文地址:https://www.cnblogs.com/zerogo/p/2209376.html
Copyright © 2020-2023  润新知