高分问题!ASP中如何插入菜单展开代码?大神们帮帮忙
1个回答
展开全部
<div class="left_muen"> <% Sql="select * from category where hide=0 and ParentID = 0 order by categoryorder" Set Rs=server.CreateObject("adodb.recordset") Rs.Open Sql,Conn,1,1 Dim a,b,c a=0 While Not Rs.Eof a=a+1 %> <div class="lanm" id="lanm<%=a%>" onclick="showHideDIV('lanm<%=a%>_',<%=Rs.recordcount%>);"><span><% = rs("category") %></span></div> <% Sql="select * from category where hide=0 and ParentID = "&Rs("categoryid")&" order by categoryorder" Set Rs1=server.CreateObject("adodb.recordset") Rs1.Open Sql,Conn,1,1 b=0 While Not Rs1.Eof b=b+1 %> <div id="lanm<%=a%>_<%=b%>" class="erji"> <div onclick="showHideDIV('lanm<%=a%>_<%=b%>_',<%=Rs1.recordcount%>);"><span>+ <% = rs1("category") %></span></div> <ul id="lanm<%=a%>_<%=b%>_1" class="listyle" style="display:none;"> <% Sql="select * from category where hide=0 and ParentID = "&Rs1("categoryid")&" order by categoryorder" Set Rs2=server.CreateObject("adodb.recordset") Rs2.Open Sql,Conn,1,1 While Not Rs2.Eof %> <li><a href="cat.asp?catid=<% = rs2("categoryid") %>"><% = rs2("category") %></a></li> <% Rs2.MoveNext Wend Set Rs2=Nothing %> </ul> </div> <% Rs1.MoveNext Wend Set Rs1=Nothing %> <!--++--> </div> <% Rs.MoveNext Wend Set Rs=Nothing %> </div>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询