| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1894 人关注过本帖
标题:求助导航菜单显示问题
只看楼主 加入收藏
dhow
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-7-26
结帖率:100%
收藏
 问题点数:0 回复次数:0 
求助导航菜单显示问题
这个目录导航是默认分类都显示的,如何改为点击后显示二级分类,再点击关闭

'=================================================
'目录树:作品图片分类目录
'函数:ShowProductSort_Tree
'参数:IsSmallClass,background_img,TdHeight,tdwidth
'IsSmallClass:是否显示小类
'background_img:大类背景图片
'TdHeight:单元格高度
'tdwidth:单元格宽度
'ClassShowMode:大类列显示个数
'=================================================
Sub ShowProductSort_Tree(IsProductName,IsSmallClass,imgpath,background_img,Link_Style,ClassShowMode,TdHeight,TdWidth)
%>
<TABLE cellSpacing=0 width="210" border=0  cellpadding="0">
    <TR>
<%
    Set Rs_Big=Conn.Execute("Select * From ProductSort Where ParentID=0 Order By PaixuID")
    If Not Rs_Big.EOF Then
        iCount=1
        Do while Not Rs_Big.EOF
%>
        <TD height=<%=TdHeight%> width=<%=tdwidth%> background="<%=background_img%>"   style="padding-left:2px;">
            <a class="<%=Link_Style%>" href="Product.asp?BigSortID=<%= Rs_Big("SortID") %>" >
            <%
            if request("BigSortID")=cstr(Rs_Big("SortID")) then%>
                <%=imgpath%><font color="#000000"><b><%= Rs_Big("SortName") %></b></font><%else%><%=imgpath%><%= Rs_Big("SortName") %>
            <%end if%>        
</a>
        
        </TD>
<!--显示大类下的产品标题-->
<%if IsProductName=True Then%>
<tr>
        <td>
            <table style="margin-left:10px;" align="center" width="217" border="0" cellspacing="0" cellpadding="0">
            <tr>   
    <%
        Set Rs_Product =Conn.Execute("Select * From Product Where SortID="&Rs_Big("SortID")&" Order By ID desc")
        If Not Rs_Product.EOF Then
            r=1
            Do while Not Rs_Product.EOF
        %>

                <td width="210"><a href="Product_Show.asp?ID=<%= Rs_Product("ID") %>"><%= Rs_Product("ProName")%></a>
</td>
        <%
                if r mod 1 = 0 then Response.write" </tr>"end if
                 Rs_Product.movenext
                r=r+1
            loop

        End if
        Rs_Product.Close
        Set Rs_Product=Nothing
        %>   
          </table>
        </td>
</tr>        
<%
End If
if IsSmallClass=True Then%>
    <TR>   
    <TD valign="top"><table align="center" width="217" border="0" cellspacing="0" cellpadding="1">
        <tr>
        <%
        Set Rs_Small =Conn.Execute("Select * From ProductSort Where ParentID="&Rs_Big("SortID")&" Order By PaixuID")
        If Not Rs_Small.EOF Then
            i=1
            Do while Not Rs_Small.EOF
        %>
          <td width="210"><div style="margin-left:10px;"><a href="Product.asp?BigSortID=<%= Rs_Big("SortID") %>&SortID=<%= Rs_Small("SortID") %>"><%= Rs_Small("SortName")%></a></div>
          </td>
          <%
                if i mod 1 = 0 then Response.write" </tr>"end if
               
                Set subRs_Small =Conn.Execute("Select * From ProductSort Where ParentID="&Rs_Small("SortID")&" Order By PaixuID")
                If Not subRs_Small.EOF Then
                    subi=1
                    Do while Not subRs_Small.EOF
        %>
          <td width="217"><div style="margin-left:20px;"><a href="Product.asp?BigSortID=<%= Rs_Small("SortID") %>&SortID=<%= subRs_Small("SortID") %>"><%= subRs_Small("SortName")%></a></div></td>
          <%
                        if subi mod 1 = 0 then Response.write" </tr>"end if
                        subRs_Small.movenext
                        subi=subi+1
                    loop
        
                End if
                subRs_Small.Close
                Set subRs_Small=Nothing
               
               
                 Rs_Small.movenext
                i=i+1
            loop

        End if
        Rs_Small.Close
        Set Rs_Small=Nothing
        %>
      </table>
      </TD>   
    </TR>
<%        
End If

                if iCount mod ClassShowMode = 0 then Response.write" </tr>"end if


        Rs_Big.MoveNext
        iCount=iCount+1
    Loop
End if
Rs_Big.Close
Set Rs_Big=Nothing
%>
</TABLE>
<%
End Sub
'结束--------------------------

前台调用的代码是
<%Call ShowProductSort_Tree(False,True,"&nbsp;","","",3,22,200)%>

[ 本帖最后由 dhow 于 2014-10-25 16:47 编辑 ]
搜索更多相关主题的帖子: 背景图片 
2014-10-25 16:46
快速回复:求助导航菜单显示问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012635 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved