动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP实例
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ ASP实例 ]的信息

本月文章推荐
.在一个ASP页面停留的多少时间的程.
.深入讲解 ASP+ 验证(二).
.用ASP、VB和XML建立互联网应用程.
.在ASP应用中验证用户身份(3).
.ASP.Net写的浏览器间谍.
.ASP网站远程客户实现EXCEL打印功.
.加密處理使密碼更安全.
.用ASP开发试题库与在线考试系统(.
.ASP 编程中 15 个非常有用的例子.
.在ASP应用中验证用户身份(1).
.2栏分页显示(附显示的形式[1][2.
.ASP连接执行程序 .
.用ASP实现号码转换程序实例.
.在ASP中使用Oracle数据库.
.聊天室建设详解一.
.一个BBS的源代码(五).
.开辟一条自由ASP快车道.
.用asp生成wml.
.在主页中编制音频播放器.
.三级下拉框连动的数据库版.

三层动态下拉菜单的例子

发表日期:2001-12-25 |


写了一个三层动态读取文件夹的下拉菜单的例子,供大家参考!
<%
'得到文件夹路径。注意设置文件名字
urlpath=server.mappath("\book")
set fsoBrowse=CreateObject("Scripting.FileSystemObject")

'设置文件夹路径
if Request("path")="" then
lpath=urlpath&"\"
else
lpath=Request("path")&"\"
end if
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv=PRAGMA CONTENT=NO-CACHE>
<title>中国国际航空公司</title>
<link rel="stylesheet" href="news.css">

<script language="JavaScript1.2">
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;

if (ver4) {
    with (document) {
        write("<STYLE TYPE='text/css'>");
        if (NS4) {
            write(".parent {position:absolute; visibility:visible}");
            write(".child {position:absolute; visibility:visible}");
            write(".regular {position:absolute; visibility:visible}")
        }
        else {
            write(".child {display:none}")
        }
        write("</STYLE>");
    }
}

function getIndex(el) {
    ind = null;
    for (i=0; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        if (whichEl.id == el) {
            ind = i;
            break;
        }
    }
    return ind;
}

function arrange() {
    nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
    for (i=firstInd+1; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        if (whichEl.visibility != "hide") {
            whichEl.pageY = nextY;
            nextY += whichEl.document.height;
        }
    }
}

function initIt(){
    if (!ver4) return;
    if (NS4) {
        for (i=0; i<document.layers.length; i++) {
            whichEl = document.layers[i];
            if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
       }
        arrange();
    }
    else {
        divColl = document.all.tags("DIV");
        for (i=0; i<divColl.length; i++) {
            whichEl = divColl(i);
            if (whichEl.className == "child") whichEl.style.display = "none";
        }
    }
}

function expandIt(el) {
    if (!ver4) return;
    if (IE4) {
        whichEl = eval(el + "Child");
        if (whichEl.style.display == "none") {
            whichEl.style.display = "block";
        }
        else {
            whichEl.style.display = "none";
        }
    }
    else {
        whichEl = eval("document." + el + "Child");
        if (whichEl.visibility == "hide") {
            whichEl.visibility = "show";
        }
        else {
            whichEl.visibility = "hide";
        }
        arrange();
    }
}

onload = initIt;

</script>

</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0">
<table width="248" border="0" cellspacing="0" cellpadding="0" align="left">
  <tr>
    <td>
     <%
       '处理第一层文件目录
       dim theFolder,theSubFolders
       if fsoBrowse.FolderExists(lpath)then
       Set theFolder=fsoBrowse.GetFolder(lpath)
       Set theSubFolders=theFolder.SubFolders
       
       '循环输出第一层文件
       i=1
       For Each x In theSubFolders
       k="KB"&i
       Parent=k&"Parent"
       i=i+1
     %>
     <div id="<%=Parent%>" class="parent"> <a href="#" onClick="expandIt('<%=k%>'); return false"><img src="i_option.gif" width="20" height="16" border="0"><%=x.Name%></a></div>
        <%'处理第二层文件
          onepath=lpath&x.Name&"\"
          if fsoBrowse.FolderExists(onepath) then
          Set ChildtheFolder=fsoBrowse.GetFolder(onepath)
          Set ChildtheSubFolders=ChildtheFolder.SubFolders
          Child=k&"Child"
        %>
          <div id="<%=Child%>" class="child">
        <%'循环输出第二层文件
          m=1
          For Each y In ChildtheSubFolders
          k="KB"&i&m
          m=m+1
        %>
            &nbsp;&nbsp;&nbsp;<img src="filebox.gif" width="19" height="13"><a href="#" onClick="expandIt('<%=k%>'); return false"><%=y.Name%></a><br>
              <%
              '处理第三层文件
              twopath=onepath&y.Name&"\"
              if fsoBrowse.FolderExists(twopath) then
                 Set gtheFolder=fsoBrowse.GetFolder(twopath)
                 Set gtheSubFolders=gtheFolder.SubFolders
                
                 Child=k&"Child"
              %>
                 <div id="<%=Child%>" class="child">
                 <%
                 '循环输出第三层文件
                 For Each z In gtheSubFolders
                                     %>                
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src="filebox.gif" width="19" height="13"><%=z.Name%><br>
                 <%
                 Next
                 %>
                 </div>
              <%
                end if
              %>
        <%
          Next
        %>
          </div>
        <%
          end if
        %>
     <%
       Next
       end if
     %>
    </td>
  </tr>
</table>
</body>
</html>

上一篇:综合的判断用户输入的合法性的函数 人气:14255
下一篇:WSH 直接将查询数据结果生成 EXCEL 表 人气:13115
浏览全部菜单的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-12-4 PhpCMS2008 bulid 081203 简体中
2008-12-4 Menalto Gallery v1.5.10 多国语
2008-12-4 Phpcms2008 bulid 081203 简体中
2008-12-4 乘风多用户计数器 v3.92 (Acc)
2008-12-4 乘风多用户计数器 v3.92 (Sql)
2008-12-4 BBSxp 2008 8.0.5 SP2 Build 081
2008-12-4 ASBLOG v2.5 bulid 081118(1201)
2008-12-4 非零坊幽默短信 v3.4
2008-12-4 红茶巴士(公交)查询系统 v3.0
2008-11-29 Tencent Traveler 4.4
2008-11-29 龙卷风网络收音机 v3.0.0.0
2008-11-29 Intel Chipset Software Install
2008-11-29 TweakVI 1.0 Build 1100
2008-11-29 Opera 9.62 Build 10469
2008-11-29 MPlayer WW编译版 SVN-r28044(20
2008-11-29 NetTools网络工具v1.0.0破解版
2008-11-29 3DGallery三维体验1.1破解版
2008-11-29 SecretBook保密本v1.0破解版
  发表评论
姓 名: 验证码:
内 容:
站长工具:网站收录查询 | Google PR查询 | ALEXA排名查询 | CSS在线编辑器 | OPEN参数生成器 | 弹出式窗口代码产生器 | 密码登录生成器 | 在线按钮生成器 | Meta标签生成器 | 多色彩特效字代码生成器 | 网页代码调试器 | 在线FTP登陆 | Flash取色器 | 配色代码对照表 | 配色辞典 | CSS生成器 | 广告代码 | 框架网页代码生成器 | js/vbs加密 | md5加密 | 进制转换 | UTF-8 转换工具 | 在线调色板 | Html转换js | Html转换asp | Html转换php | Html转换perl
实用工具:汉字翻译拼音 | 拼音字典 | 符号对照表 | 个税计算 | 实时汇率查询换算 | 经典小工具 | 汉字简繁转换 | 普通单位换算 | 公制单位换算 | 生辰老黄历 | 国内电话区号 | 国家代码与域名缩写 | 文字加密解密 | 元素周期表 | 健康查询 | 世界时间 | 万年历 | 二十四节气 | 汉字横竖排版 | 手机号码查询 | 计算器 | ip搜索
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2009 www.knowsky.com All rights reserved | 沪ICP备05001343号