用ASP命令实现下面功能,答案给的好多加分
我想实现如下功能:*菜单名1(1)...(2)...(3)...(4)...(5)...*菜单名2*菜单名3*菜单名4以上4个菜单中,当我点菜单名1的时候,下拉出(1)....
我想实现如下功能:
*菜单名1
(1)...
(2)...
(3)...
(4)...
(5)...
*菜单名2
*菜单名3
*菜单名4
以上4个菜单中,当我点菜单名1的时候,下拉出(1)...(5)几个子菜单,当我点菜单2的时候,菜单(1)...(5)自动收缩回菜单1下隐藏起来,只显示菜单名2中的子菜单.
急求,各位大侠帮帮忙! 展开
*菜单名1
(1)...
(2)...
(3)...
(4)...
(5)...
*菜单名2
*菜单名3
*菜单名4
以上4个菜单中,当我点菜单名1的时候,下拉出(1)...(5)几个子菜单,当我点菜单2的时候,菜单(1)...(5)自动收缩回菜单1下隐藏起来,只显示菜单名2中的子菜单.
急求,各位大侠帮帮忙! 展开
展开全部
<SCRIPT language=javascript>
function dis(idx,img)
{
csh();
var buyok = document.getElementById('swf_'+idx);
var buyok2 = document.getElementById('img'+idx);
if(buyok.style.display=="none"){
buyok.style.display="";
buyok2.src="imgs/-.gif";
} else {
buyok.style.display="none";
buyok2.src="imgs/+.gif";
}
}
</SCRIPT>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
lsort=request.QueryString("sort")
lsorts=request.QueryString("sorts")
if lsort="" then lsort=1
if lsorts="" then lsorts=1
sql="select * from sort order by index"
rs.open sql,conn,3
rs.pagesize=rs.recordcount
rs.absolutepage=1
for i=1 to rs.pagesize
if rs.bof or rs.eof then exit for
TBs="none"
if rs("id")=int(lsort) then TBs="block"
%>
<tr>
<td width="20" valign="middle"
style="CURSOR: hand" onClick="dis('<%=i%>', img1);" ><img src="imgs/+.gif" name="img<%=i%>" width="20" height="20" id="img<%=i%>" /></td>
<td width="955" valign="middle"
style="CURSOR: hand" onClick="dis('<%=i%>', img1);" ><span class="Hei14" ><%=rs("name")%></span></td>
</tr>
<tr>
<td colspan="2" id=swf_<%=i%> style="DISPLAY: <%=tbs%>">
<%sql2="select * from sorts where sort=" & rs("id") & " order by index"
rs2.open sql2,conn,3
rs2.pagesize=rs2.recordcount
rs2.absolutepage=1
for i2=1 to rs2.pagesize
if rs2.bof or rs2.eof then exit for
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24"><img src="imgs/[.gif" width="24" height="20" /></td>
<td width="951"><A href="List.asp?sort=<%=rs("id")%>&sorts=<%=rs2("id")%>" ><%=rs2("name")%></A></td>
</tr>
</table> <%
rs2.movenext
next
rs2.close%> </td>
</tr>
<%
rs.movenext
next
%>
<script>
var s;
function csh()
{
var buyok;
var buyok2
for(s=1;s<=<%=i-1%>;s++)
{
buyok = document.getElementById('swf_'+s);
buyok2 = document.getElementById('img'+s);
buyok.style.display="none";
buyok2.src="imgs/+.gif";
}
}
</script>
<%rs.close%>
</table>
function dis(idx,img)
{
csh();
var buyok = document.getElementById('swf_'+idx);
var buyok2 = document.getElementById('img'+idx);
if(buyok.style.display=="none"){
buyok.style.display="";
buyok2.src="imgs/-.gif";
} else {
buyok.style.display="none";
buyok2.src="imgs/+.gif";
}
}
</SCRIPT>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
lsort=request.QueryString("sort")
lsorts=request.QueryString("sorts")
if lsort="" then lsort=1
if lsorts="" then lsorts=1
sql="select * from sort order by index"
rs.open sql,conn,3
rs.pagesize=rs.recordcount
rs.absolutepage=1
for i=1 to rs.pagesize
if rs.bof or rs.eof then exit for
TBs="none"
if rs("id")=int(lsort) then TBs="block"
%>
<tr>
<td width="20" valign="middle"
style="CURSOR: hand" onClick="dis('<%=i%>', img1);" ><img src="imgs/+.gif" name="img<%=i%>" width="20" height="20" id="img<%=i%>" /></td>
<td width="955" valign="middle"
style="CURSOR: hand" onClick="dis('<%=i%>', img1);" ><span class="Hei14" ><%=rs("name")%></span></td>
</tr>
<tr>
<td colspan="2" id=swf_<%=i%> style="DISPLAY: <%=tbs%>">
<%sql2="select * from sorts where sort=" & rs("id") & " order by index"
rs2.open sql2,conn,3
rs2.pagesize=rs2.recordcount
rs2.absolutepage=1
for i2=1 to rs2.pagesize
if rs2.bof or rs2.eof then exit for
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="24"><img src="imgs/[.gif" width="24" height="20" /></td>
<td width="951"><A href="List.asp?sort=<%=rs("id")%>&sorts=<%=rs2("id")%>" ><%=rs2("name")%></A></td>
</tr>
</table> <%
rs2.movenext
next
rs2.close%> </td>
</tr>
<%
rs.movenext
next
%>
<script>
var s;
function csh()
{
var buyok;
var buyok2
for(s=1;s<=<%=i-1%>;s++)
{
buyok = document.getElementById('swf_'+s);
buyok2 = document.getElementById('img'+s);
buyok.style.display="none";
buyok2.src="imgs/+.gif";
}
}
</script>
<%rs.close%>
</table>
参考资料: http://www.ndfweb.cn
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询