国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

三層動(dòng)態(tài)下拉菜單的例子

2019-11-18 20:24:13
字體:
供稿:網(wǎng)友
寫了一個(gè)三層動(dòng)態(tài)讀取文件夾的下拉菜單的例子,供大家參考!
<%
'得到文件夾路徑。注意設(shè)置文件名字
urlpath=server.mappath("/book")
set fsoBrowse=CreateObject("Scrif 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
       
       '循環(huán)輸出第一層文件
       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">
        <%'循環(huán)輸出第二層文件
          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">
                 <%
                 '循環(huán)輸出第三層文件
                 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>


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 马龙县| 贺兰县| 广南县| 牟定县| 苗栗县| 溧水县| 西和县| 龙州县| 阳城县| 靖边县| 涪陵区| 永仁县| 麟游县| 临夏县| 绵竹市| 海阳市| 黄浦区| 兰州市| 胶州市| 安徽省| 秦安县| 鄯善县| 遂昌县| 班戈县| 保康县| 玛纳斯县| 邮箱| 广元市| 昌平区| 峡江县| 福州市| 华阴市| 宾川县| 涞源县| 桐乡市| 左云县| 福安市| 从江县| 镇赉县| 鹤庆县| 宜兰县|