ASP结合JAVASCRIPT二级伸缩菜单

<SCRIPT language=javascript>
function showmenu(buyok,id,total)
{


 for(v=1;v<(total+1);v++)
 {
  if(v!=id)
  eval('document.all.buyok'+v+'.style.display="none" ') ;
  else
  
  if(buyok.style.display=="none")
  {
  buyok.style.display="";
  }
  else
  {
  buyok.style.display="none";
  }
  
  
 }
 
 
}
</SCRIPT>
  
<table width="100%" border="0" cellpadding="0" cellspacing="0" >
<%
isb_id=request.QueryString("l_id")
isb_id=clng(isb_id)

sql="select count(*) as total  from [bigClass]" 
set rs = conn.execute(sql)
total=rs("total")
rs.close

sql="select * from [BigClass] order by b_id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
else
lar=1
do until rs.eof
b_id=rs("b_id")
b_name=rs("b_name")
 %>
  
       <tr>
            <td width="10%" height="25">&nbsp;</td>
            <td width="90%" height="25"><img src="images/big.gif"> <a href="#" οnclick="showmenu(buyok<%=lar%>,<%=lar%>,<%=total%>);" class="mf" ><strong><%=b_name%></strong></a></td>
          </tr>
     
     <tr id=buyok<%=lar%> <% if isb_id=b_id then %><%else%>  style="DISPLAY: none" <%end if%>>
     <td height="25" colspan="2" style="padding-left:20px;">
     
        <%
  set rstwo=server.createobject("adodb.recordset")
  sqltwo="select * from [smallClass] where b_id="&b_id&" order by b_id desc"
  rstwo.open sqltwo,conn,1,1
  if rstwo.eof and rstwo.bof then
  else
  do until rstwo.eof
  %>
                   <table width="100%" border="0">
                      <tr>
         <td>
                      <img src="images/small.gif"> <a href="product.asp?s_id=<%=rstwo("s_id")%>&l_id=<%=b_id%>"><%=rstwo("s_name")%></a>
                         </td>
       </tr>
       </table>
     
     
        <%
  rstwo.movenext
  loop
  end if
  rstwo.close
  set rstwo=nothing
  %>
  
  </td>
  </tr>
   
   
<%
rs.movenext
lar=lar+1
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</table>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值