选择显示字体大小

三层动态下来菜单的例子,供大家参考


写了一个三层动态读取文件夹的下拉菜单的例子,供大家参考!
<&#37;
&#39;得到文件夹路径。注意设置文件名字
urlpath=server.mappath(&quot;\book&quot;)
set fsobrowse=createobject(&quot;scripting.filesystemobject&quot;)

&#39;设置文件夹路径
if request(&quot;path&quot;)=&quot;&quot; then
lpath=urlpath&&quot;\&quot;
else
lpath=request(&quot;path&quot;)&&quot;\&quot;
end if
&#37;>

<html>
<head>
<meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=gb2312&quot;>
<meta http-equiv=pragma content=no-cache>
<title>中国国际航空公司</title>
<link rel=&quot;stylesheet&quot; href=&quot;news.css&quot;>

<script language=&quot;javascript1.2&quot;>
ns4 = (document.layers) ? 1 : 0;
ie4 = (document.all) ? 1 : 0;
ver4 = (ns4 ie4) ? 1 : 0;

if (ver4) {
with (document) {
write(&quot;<style type=&#39;text/css&#39;>&quot;);
if (ns4) {
write(&quot;.parent {position:absolute; visibility:visible}&quot;);
write(&quot;.child {position:absolute; visibility:visible}&quot;);
write(&quot;.regular {position:absolute; visibility:visible}&quot;)
}
else {
write(&quot;.child {display:none}&quot;)
}
write(&quot;</style>&quot;);
}
}

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 != &quot;hide&quot;) {
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(&quot;child&quot;) != -1) whichel.visibility = &quot;hide&quot;;
}
arrange();
}
else {
divcoll = document.all.tags(&quot;div&quot;);
for (i=0; i<divcoll.length; i++) {
whichel = divcoll(i);
if (whichel.classname == &quot;child&quot;) whichel.style.display = &quot;none&quot;;
}
}
}

function expandit(el) {
if (!ver4) return;
if (ie4) {
whichel = eval(el + &quot;child&quot;);
if (whichel.style.display == &quot;none&quot;) {
whichel.style.display = &quot;block&quot;;
}
else {
whichel.style.display = &quot;none&quot;;
}
}
else {
whichel = eval(&quot;document.&quot; + el + &quot;child&quot;);
if (whichel.visibility == &quot;hide&quot;) {
whichel.visibility = &quot;show&quot;;
}
else {
whichel.visibility = &quot;hide&quot;;
}
arrange();
}
}

onload = initit;

</script>

</head>
<body bgcolor=&quot;#ffffff&quot; topmargin=&quot;0&quot; leftmargin=&quot;0&quot;>
<table width=&quot;248&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; align=&quot;left&quot;>
<tr>
<td>
<&#37;
&#39;处理第一层文件目录
dim thefolder,thesubfolders
if fsobrowse.folderexists(lpath)then
set thefolder=fsobrowse.getfolder(lpath)
set thesubfolders=thefolder.subfolders

&#39;循环输出第一层文件
i=1
for each x in thesubfolders
k=&quot;kb&quot;&i
parent=k&&quot;parent&quot;
i=i+1
&#37;>
<div id=&quot;<&#37;=parent&#37;>&quot; class=&quot;parent&quot;> <a href=&quot;#&quot; onclick=&quot;expandit(&#39;<&#37;=k&#37;>&#39;); return false&quot;><img alt=三层动态下来菜单的例子,供大家参考 src=&quot;i_option.gif&quot; width=&quot;20&quot; height=&quot;16&quot; border=&quot;0&quot;><&#37;=x.name&#37;></a></div>
<&#37;&#39;处理第二层文件
onepath=lpath&x.name&&quot;\&quot;
if fsobrowse.folderexists(onepath) then
set childthefolder=fsobrowse.getfolder(onepath)
set childthesubfolders=childthefolder.subfolders
child=k&&quot;child&quot;
&#37;>
<div id=&quot;<&#37;=child&#37;>&quot; class=&quot;child&quot;>
<&#37;&#39;循环输出第二层文件
m=1
for each y in childthesubfolders
k=&quot;kb&quot;&i&m
m=m+1
&#37;>
&nbsp;&nbsp;&nbsp;<img alt=三层动态下来菜单的例子,供大家参考 src=&quot;filebox.gif&quot; width=&quot;19&quot; height=&quot;13&quot;><a href=&quot;#&quot; onclick=&quot;expandit(&#39;<&#37;=k&#37;>&#39;); return false&quot;><&#37;=y.name&#37;></a><br>
<&#37;
&#39;处理第三层文件
twopath=onepath&y.name&&quot;\&quot;
if fsobrowse.folderexists(twopath) then
set gthefolder=fsobrowse.getfolder(twopath)
set gthesubfolders=gthefolder.subfolders

child=k&&quot;child&quot;
&#37;>
<div id=&quot;<&#37;=child&#37;>&quot; class=&quot;child&quot;>
<&#37;
&#39;循环输出第三层文件
for each z in gthesubfolders
&#37;>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img alt=三层动态下来菜单的例子,供大家参考 src=&quot;filebox.gif&quot; width=&quot;19&quot; height=&quot;13&quot;><&#37;=z.name&#37;><br>
<&#37;
next
&#37;>
</div>
<&#37;
end if
&#37;>
<&#37;
next
&#37;>
</div>
<&#37;
end if
&#37;>
<&#37;
next
end if
&#37;>
</td>
</tr>
</table>
</body>
</html>


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons