<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
<title>树形导航菜单</title>
<style type="text/css">
<!--
.parent{ width:200px; height:30px; font-size:14px; line-height:30px;}
.child{ width:200px; height:auto; font-size:12px; line-height:20px;}
-->
</style>
<script language="JavaScript1.2">
scores = new Array(20);var numTotal=0;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("C") != -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) {
whichEl1 = eval(el + "C");
for(I=1;I<=numTotal;I++){
whichEl = eval(scores[I] + "C");
if(whichEl!=whichEl1) {
whichEl.style.display = "none";
}
}
whichEl1 = eval(el + "C");
if (whichEl1.style.display == "none") {
whichEl1.style.display = "block";
}
else {
whichEl1.style.display = "none";
}
}
else {
whichEl = eval("document." + el + "C");
for(I=1;I<=numTotal;I++){
whichEl = eval("document." + scores[I] + "C");
if(whichEl!=whichEl1) {
whichEl.visibility = "hide";
}
}
if (whichEl.visibility == "hide") {
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}}onload = initIt;
</script>
</head>
<body bgcolor="" >
<div><a href="#"> +时间日期类</a></div>
<div>
<a href='https://www.jb51.net/time1.htm' target='_target'> +任意位置显示时钟</a><br>
<a href='https://www.jb51.net/time2.htm' target='_target'> +倒计时代码生成器</a><br>
<a href='https://www.jb51.net/time3.htm' target='_target'> -八种风格时间显示</a><br>
<a href='https://www.jb51.net/time8.htm' target='_target'> -全中文日期显示</a></div>
<div><a href="#"> +页面导航类</a></div>
<div>
<a href='https://www.jb51.net/dao1.htm' target='_target'> -显示站点信息导航</a><br>
<a href='https://www.jb51.net/dao9.htm' target='_target'> -友情链接导航框</a><br>
<a href='https://www.jb51.net/dao10.htm' target='_target'> -目录式导航菜单</a><br>
<a href='https://www.jb51.net/dao11.htm' target='_target'> -重要信息说明脚本</a> </div>
<div><a href="#"> +页面背景类</a></div>
<div>
<a href='https://www.jb51.net/back1.htm' target='_target'> -背景向下移动</a><br>
<a href='https://www.jb51.net/back2.htm' target='_target'> -背景不停变换色彩</a><br>
<a href='https://www.jb51.net/back9.htm' target='_target'> -页面转换特效</a></div>
<div><a href="#"> +页面特效类</a></div>
<div>
<a href='https://www.jb51.net/ye1.htm' target='_target'> -字符从空中掉下来</a><br>
<a href='https://www.jb51.net/ye17.htm' target='_target'> -鼠标响应文字变色</a> </div>
<div><a href="#"> +图形图象类</a></div>
<div>
<a href='https://www.jb51.net/picture1.htm' target='_target'> -禁止图片下载</a><br>
<a href='https://www.jb51.net/picture11.htm' target='_target'> -图形选择脚本</a><br>
<a href='https://www.jb51.net/picture12.htm' target='_target'> -图片翻滚导航</a><br>
<a href='https://www.jb51.net/picture13.htm' target='_target'> -图片翻滚导航</a> </div>
<div><a href="#"> +按钮特效类</a></div>
<div>
<a href='https://www.jb51.net/an2.htm' target='_target'> -跑马灯式链接说明</a><br>
<a href='https://www.jb51.net/an7.htm' target='_target'> -按顺序点击链接</a></div>
<div><a href="#"> +鼠标事件类</a></div>
<div>
<a href='https://www.jb51.net/shu1.htm' target='_target'> -图片跟随鼠标</a><br>
<a href='https://www.jb51.net/shu5.htm' target='_target'> -禁用右键自动导航</a><br>
<a href='https://www.jb51.net/shu6.htm' target='_target'> -鼠标激活警告框</a> </div>
<div><a href="#"> +Cookie脚本</a></div>
<div>
<a href='https://www.jb51.net/cook1.htm' target='_target'> -随登陆次数变提示</a><br>
<a href='https://www.jb51.net/cook8.htm' target='_target'> -检测IE去过站点</a><br>
<a href='https://www.jb51.net/cook9.htm' target='_target'> -离开时显示信息</a><br>
<a href='https://www.jb51.net/cook10.htm' target='_target'> -弹出窗口自动关闭</a><br>
<a href='https://www.jb51.net/cook11.htm' target='_target'> -离开页面弹出窗口</a><br>
<a href='https://www.jb51.net/cook12.htm' target='_target'> -进入时显示信息</a></div>
<div><a href="#"> +文本特效类</a></div>
<div>
<a href='https://www.jb51.net/text1.htm' target='_target'> -随机信息显示</a><br>
<a href='https://www.jb51.net/ye9.htm' target='_target'> -文字颜色渐变脚本</a><br>
<a href='https://www.jb51.net/ye5.htm' target='_target'> -文本自动输出</a></div>
<div><a href="#"> +状态栏特效</a></div>
<div>
<a href='https://www.jb51.net/ye8.htm' target='_target'> -状态栏跑马灯脚本</a><br>
<a href='https://www.jb51.net/zhuang1.htm' target='_target'> -文字从右弹出</a><br>
<a href='https://www.jb51.net/zhuang8.htm' target='_blank'> -title变化弹出</a></div>
<div><a href="#"> +密 码 类</a></div>
<div>
<a href='https://www.jb51.net/password1.htm' target='_target'> -控制他人进入页面</a><br>
<a href='https://www.jb51.net/password3.htm' target='_target'> 用来实现会员制度</a><br>
<a href='https://www.jb51.net/password4.htm' target='_target'> -密码保护相应页面</a><br>
<a href='https://www.jb51.net/password5.htm' target='_target'> -自己编制密码表</a></div>
<div><a href="#"> +综 合 类</a></div>
<div>
<a href='https://www.jb51.net/zh1.htm' target='_target'> -加密页面源代码</a><br>
<a href='https://www.jb51.net/zh2.htm' target='_target'> -访问时间限制</a><br>
<a href='https://www.jb51.net/zh11.htm' target='_target'> -搜索引擎登记</a><br>
<a href='https://www.jb51.net/zh12.htm' target='_target'> -下载记时器脚本</a> </div>
<div><a href="#"> +游 戏 类</a></div>
<div> <a href='https://www.jb51.net/you1.htm' target='_target'> -一款流行游戏</a></div>
<script language="javascript">
numTotal=14;
scores[1]='KB1';
scores[2]='KB1';
scores[3]='KB2';
scores[4]='KB3';
scores[5]='KB4';
scores[6]='KB5';
scores[7]='KB6';
scores[8]='KB7';
scores[9]='KB8';
scores[10]='KB9';
scores[11]='KB10';
scores[12]='KB11';
scores[13]='KB12';
scores[14]='KB13';
</script>
</body>
</html></td>
</tr>
</table>
javascript 树形导航菜单实例代码
内容版权声明:除非注明,否则皆为本站原创文章。