三级动态树形菜单

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

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

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

 

< ! -- #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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值