CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

请问如何才能增加菜单展开和折叠的图片

楼主hbsxxmm(随缘居)2006-04-01 22:25:18 在 Web 开发 / ASP 提问

请问如何才能增加菜单展开和折叠的图片"  
  <%@LANGUAGE="VBSCRIPT"   CODEPAGE="936"%>  
  <!--#include   file="../inc/conn.asp"-->  
  <!--#include   file="../checkuser.asa"-->    
  <%  
  if   session("grade")="1"   then  
        response.write"<SCRIPT   language=JavaScript>alert('对不起,你没有操作此栏目的权限!');"  
                              response.write"javascript:history.go(-1)</SCRIPT>"        
                              response.end    
        end   if  
   
   
  %>  
   
  <body   bgcolor="#C6DBFF"   style="font-size:   10pt">  
  <table   width="122%"   cellspacing="0"   cellpadding="0"   align=left   class="tableBorder"   size=2   color="#FF0000">  
  <font   >  
  <tr>  
  </tr>  
  <table   border="0"   width="122%"   id="table2">  
  <tr><td   width="122%"   height="122%">  
  <p>  
   
  <%  
   
  set   rs=server.createobject("adodb.recordset")  
  sql="select   *   from   nsr_info"  
  rs.open   sql,conn,1,1  
  allnum=rs.RecordCount  
  '取得最大的层数MaxLevel%>  
   
  <%  
  MaxLevel=1          
  for   i=1   to   allnum  
  if   rs("ParentID")>MaxLevel   then  
          MaxLevel=rs("ParentID")  
  else  
          MaxLevel=MaxLevel  
  end   if  
  rs.movenext  
  next  
  rs.close  
  set   rs=nothing  
   
  %>  
  <html>  
  <head>  
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">  
  <title>纳税人基本情况</title>  
  <style   type="text/css">  
  <!--  
  td   {  
  font-size:   12px;  
  }  
  -->  
  </style>  
   
  <script   language="javascript">  
  <!--    
   
  function   divshow(cmy1,cmy2,cmy3)  
  file://展开/合并菜单函数  
  {  
      if(document.all("div"+cmy1+cmy2+cmy3).style.display==""){  
          document.all("div"+cmy1+cmy2+cmy3).style.display="none"  
  }  
  else{  
          document.all("div"+cmy1+cmy2+cmy3).style.display=""  
  }  
  }  
  file://-->  
  </script>  
  </head>  
  <body   bgcolor="#33CCFF"   topmargin="0"   onload="divshow(1,0,1);">  
  <table   border="0"   cellpadding="0"   cellspacing="0">  
  <%  
  dim   toumh(10)   '定义用于存放菜单前显示树图片的数组,如果应用时的最大级数大于十,请扩大数组维数  
  call   menutree(1,0,MaxLevel,1)'首次调用菜单输出函数  
  '第一个参数:菜单的级数  
  '第二个参数:父菜单的ID,一级菜单默认为零  
  '第三个参数:菜单的最大级数  
  '第四个参数:用于区分层的名称,方便实现菜单的展开合并  
  %>  
  </table>  
  <%  
   
  'funno     菜单的级数  
  'funcid     父菜单的ID,一级菜单父级ID值为0  
  'MaxLevel     菜单的最大级数  
  'divno     用于区分层的名称,方便实现菜单的展开合并  
  'menutree()     数形菜单输出函数  
  function   menutree(funno,nsrid,MaxLevel,divno)  
      dim   rsfun,numfun,funcidfun  
  if   session("shnum")<>""   then  
  set   rsl   =   server.CreateObject   ("adodb.recordset")  
  sqll   =   "select   *   from   nsr_info   where   tax_no='"&session("shnum")&"'"  
  rsl.Open   sqll,conn,1,1  
      strQuery1="select   *   from   nsr_info   where   tlid='"&rsl("tlid")&"'   and   ParentStr='"&nsrid&"'"  
  end   if  
  if   session("mcname")<>""   then  
  set   rsmc   =   server.CreateObject   ("adodb.recordset")  
  sqlmc   =   "select   *   from   nsr_info   where   tax_name='"&session("mcname")&"'"  
  rsmc.Open   sqlmc,conn,1,1  
      strQuery1="select   *   from   nsr_info   where   tlid='"&rsmc("tlid")&"'   and   ParentStr='"&nsrid&"'"  
  end   if  
   
   
  set   rsfun=server.createobject("adodb.recordset")  
      rsfun.open   strQuery1,conn,1,1  
      numfun=rsfun.RecordCount  
      response.Write("<tr><td>")  
      response.Write("<div   id='div"&funno&nsrid&divno&"'   style='display:none'>")'输出层,并根据相关参数给层定义唯一的ID名称  
      response.Write("<table   border='0'   cellpadding='0'   cellspacing='0'>")  
      for   j=1   to   numfun  
      funcidfun=rsfun("nsrid")  
      if   j=numfun   then       '判断是否是本级菜单的最后一个  
          toumh(funno)="space.gif"     '是则输出空白图片space.gif  
      else  
          toumh(funno)="line_v.gif"   '否则输出竖线图片line_v.gif  
      end   if  
  '判断是否有下级菜单  
          strQuery2="select   *   from   nsr_info   where   ParentStr='"&funcidfun&"'"  
          set   rsfun2=server.createobject("adodb.recordset")  
          rsfun2.open   strQuery2,conn,1,1  
          numfun2=rsfun2.RecordCount  
  orders=rsfun("orders")  
  '如果numfun2>0则有,反之则无  
          if   numfun2   >   0   then  
                  response.Write("<tr   onClick='javascript:divshow("&funno+1&","&funcidfun&","&j&");'   style='cursor:hand'>")    
                      '用单击事件调用展开/合并菜单函数  
          else  
        response.Write("<tr   style='cursor:hand'>")  
          end   if  
          response.Write("<td>")  
          if   numfun2   >   0   then  
              treeico="close_normal.gif"  
        if   j=numfun   then  
                  treeico="close_end.gif"  
        end   if        
          else  
              treeico="none_normal.gif"  
        if   j=numfun   then  
                  treeico="none_end.gif"  
        end   if        
          end   if  
  for   m=1   to   cint(funno)-1         '根据当前菜单的级数输出菜单前的数形图片  
              response.Write("<img   src='images/"&toumh(m)&"'   align='absMiddle'>")  
          next  
          response.Write("<img   src='images/"&treeico&"'   align='absMiddle'><a   style='text-decoration:   none'   href=nsr_edit.asp?nsr_id="&rsfun("nsrid")&"&amp;tax_name="&rsfun("tax_name")&"&amp;tax_no="&rsfun("tax_no")&"   target='I2'>"&left(rsfun("tax_name"),8))'输出可用菜单名  
  Response.Write   "</a>"  
  if   rsfun("orders")<>"0"   then  
  Response.Write   "["  
  Response.Write   orders  
  Response.Write   "]"  
  end   if  
  response.Write("</td>")  
          response.Write("</tr>")  
  if   cint(funno)<cint(MaxLevel)   then  
        call   menutree(cint(funno)+1,funcidfun,MaxLevel,j)     '递归调用   menutree()函数  
          end   if  
   
  rsfun.movenext    
      next  
      'response.Write("</td></tr>")  
      response.Write("</table></div>")  
      response.Write("</td></tr>")  
  end   function  
   
  %></html></table></font>  
      </td>  
  问题点数:20、回复次数:4Top

1 楼taolixiang(飞扬 怎么还不升级!!...... 哦 ...... 原来是要答对题才能升!)回复于 2006-04-01 22:51:21 得分 10

晕了,帮你顶吧  
  Top

2 楼yuanxiaolei(袁小磊)回复于 2006-04-01 23:42:30 得分 10

http://www.piaoy.cn/cxxz.asp  
  中的  
   
  菜单2Top

3 楼hbsxxmm(随缘居)回复于 2006-04-02 08:04:37 得分 0

不能下载。不能注册呀?Top

4 楼hbsxxmm(随缘居)回复于 2006-04-02 22:47:42 得分 0

还请高手多给予指导!!Top

相关问题

关键词

得分解答快速导航

  • 帖主:hbsxxmm
  • taolixiang
  • yuanxiaolei

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo