我有2个类似的js,不知道有用否 1
发表于:2007-06-30来源:作者:点击数:
标签:
脚本说明: 第一步:把如下代码加入head区域中 script language= Java Script1.2 scores = new Array(20);var numTotal=0;NS4 = (document.layers) ? 1 : 0;IE4 = (doc ument.all) ? 1 : 0;ver4 = (NS4 || IE4) ? 1 : 0;if (ver4) {with (document) { write(STY
脚本说明:
第一步:把如下代码加入<head>区域中
<script language="
JavaScript1.2">
scores = new Array(20);var numTotal=0;NS4 = (document.layers) ? 1 : 0;IE4 = (doc
ument.all) ? 1 : 0;ver4 = (NS4 || IE4) ? 1 : 0;if (ver4) { with (document) {
write("<STYLE TYPE=@#text/css@#>"); if (NS4) { write(".pare
nt {position:absolute; visibility:visible}"); write(".child {position:
absolute; visibility:visible}"); write(".regular {position:absolute; v
isibility:visible}") } else { write(".child {display:non
e}") } write("</STYLE>"); }}function getIndex(el) { ind = nul
l; 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].p
ageY +document.layers[firstInd].document.height; for (i=firstInd+1; i<document
.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.vi
sibility != "hide") { whichEl.pageY = nextY; nextY += which
El.document.height; } }}function initIt(){ if (!ver4) return; if
(NS4) { for (i=0; i<document.layers.length; i++) { whichEl = do
cument.layers[i]; if (whichEl.id.indexOf("Child") != -1) whichEl.visib
ility = "hide"; } arrange(); } else { divColl = documen
t.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 + "Child"); for(i=1;i<=numTotal;i++){
whichEl = eval(scores[i] + "Child"); if(whichEl!=whichEl1) {
whichEl.style.display = "none"; } } whichEl1 =
eval(el + "Child"); if (whichEl1.style.display == "none") { whi
chEl1.style.display = "block"; } else { whichEl1.style.d
isplay = "none"; } } else { whichEl = eval("document." + el +
"Child"); for(i=1;i<=numTotal;i++){ whichEl = eval("document."
+ scores[i] + "Child"); if(whichEl!=whichEl1) { whichE
l.visibility = "hide"; } } if (whichEl.visibility == "hi
de") { whichEl.visibility = "show"; } else {
whichEl.visibility = "hide"; } arrange(); }}onload = initIt;
</script>
第二步:把如下代码加入<body>区域中
<div id="KB1Parent" class="parent"><a href="#" onClick="expandIt(@#KB1@#); return
false">
<img SRC="plus.gif" BORDER="0">时间日期类</a></div><div id="KB1Child" class="par
ent">
<a href="time1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">任意位置显
示时钟</a><br>
<a href="time2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">倒计时代码
生成器</a><br>
<a href="time3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">八种风格时
间显示</a><br>
<a href="time4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">显示登陆时
间</a><br>
<a href="time5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">日历生成器
</a><br>
<a href="time6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">退出显示访
问时间</a><br>
<a href="time7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">一款特酷的
时钟</a><br>
<a href="time8.htm" target="_target"> <img SRC="blank.gif" BORDER="0">全中文日期
显示</a></div>
<div id="KB2Parent" class="parent"><a href="#" onClick="expandIt(@#KB2@#); return
false">
<img SRC="plus.gif" BORDER="0">页面导航类</a></div><div id="KB2Child" class="chi
ld">
<a href="dao1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">显示站点信息
导航</a><br>
<a href="dao2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">任意显示导航
信息</a><br>
<a href="dao3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">动态导航脚本
</a><br>
<a href="dao4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">下拉式导航菜
单</a><br>
<a href="dao5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">静止导航菜单
</a><br>
<a href="dao6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">静止图片脚本
</a><br>
<a href="dao7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文本静止不动
</a><br>
<a href="dao8.htm" target="_target"> <img SRC="blank.gif" BORDER="0">信息框显示链
接</a><br>
<a href="dao9.htm" target="_target"> <img SRC="blank.gif" BORDER="0">友情链接导航
框</a><br>
<a href="dao10.htm" target="_target"> <img SRC="blank.gif" BORDER="0">目录式导航
菜单</a><br>
<a href="dao11.htm" target="_target"> <img SRC="blank.gif" BORDER="0">重要信息说
明脚本</a>
</div>
<div id="KB3Parent" class="parent"><a href="#" onClick="expandIt(@#KB3@#); return
false">
<img SRC="plus.gif" BORDER="0">页面背景类</a></div><div id="KB3Child" class="chi
ld">
<a href="back1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">背景向下移
动</a><br>
<a href="back2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">背景不停变
换色彩</a><br>
<a href="back3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">使页面产生
百叶窗</a><br>
<a href="back4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">颜色代码英
文集</a><br>
<a href="back5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">自已选择背
景颜色</a><br>
<a href="back6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">背景颜色安
全
测试</a><br>
<a href="back7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">颜色选择器
</a><br>
<a href="back8.htm" target="_target"> <img SRC="blank.gif" BORDER="0">背景图片居
中</a><br>
<a href="back9.htm" target="_target"> <img SRC="blank.gif" BORDER="0">页面转换特
效</a></div>
<div id="KB4Parent" class="parent"><a href="#" onClick="expandIt(@#KB4@#); return
false">
<img SRC="plus.gif" BORDER="0">页面特效类</a></div><div id="KB4Child" class="chi
ld">
<a href="ye1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">字符从空中掉
下来</a><br>
<a href="ye2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">打字机式输出
文字</a><br>
<a href="ye4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">滚动显示的LO
GO</a><br>
<a href="ye6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文本自动滚屏
</a><br>
<a href="ye7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">控制别人输入
字数</a><br>
<a href="ye10.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文本上下弹跳
</a><br>
<a href="ye11.htm" target="_target"> <img SRC="blank.gif" BORDER="0">特酷消隐字体
</a><br>
<a href="ye12.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文本框栏目介
绍</a><br>
<a href="ye13.htm" target="_target"> <img SRC="blank.gif" BORDER="0">旋转变换文字
</a><br>
<a href="ye14.htm" target="_target"> <img SRC="blank.gif" BORDER="0">特酷的文本输
出</a><br>
<a href="ye18.htm" target="_target"> <img SRC="blank.gif" BORDER="0">页面自动滚屏
效果</a><br>
<a href="ye16.htm" target="_target"> <img SRC="blank.gif" BORDER="0">炽热的文字特
效</a><br>
<a href="ye17.htm" target="_target"> <img SRC="blank.gif" BORDER="0">鼠标响应文字
变色</a>
</div>
<div id="KB5Parent" class="parent"><a href="#" onClick="expandIt(@#KB5@#); return
false">
<img SRC="plus.gif" BORDER="0">图形图象类</a></div><div id="KB5Child" class="chi
ld">
<a href="picture1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">禁止图片
下载</a><br>
<a href="picture2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图片隐现
效果</a><br>
<a href="picture3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">随机显示
图片</a><br>
<a href="picture4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图片变形
扭曲</a><br>
<a href="picture5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">雪景</a
><br>
<a href="picture7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图片渐渐
出现</a><br>
<a href="picture8.htm" target="_target"> <img SRC="blank.gif" BORDER="0">相片选择
器</a><br>
<a href="picture9.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图形循环
渐显</a><br>
<a href="picture10.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图形左
右晃动</a><br>
<a href="picture11.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图形选
择脚本</a><br>
<a href="picture12.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图片翻
滚导航</a><br>
<a href="picture13.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图片翻
滚导航</a>
</div>
<div id="KB6Parent" class="parent"><a href="#" onClick="expandIt(@#KB6@#); return
false">
<img SRC="plus.gif" BORDER="0">按钮特效类</a></div><div id="KB6Child" class="chi
ld">
<a href="an2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">跑马灯式链接
说明</a><br>
<a href="an3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">窗口打开关闭
</a><br>
<a href="an4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">浮动的链接说
明</a><br>
<a href="an5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">链接处变换色
彩</a><br>
<a href="an6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">变换链接色和
底色</a><br>
<a href="an7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">按顺序点击链
接</a></div>
<div id="KB7Parent" class="parent"><a href="#" onClick="expandIt(@#KB7@#); return
false">
<img SRC="plus.gif" BORDER="0">鼠标事件类</a></div><div id="KB7Child" class="chi
ld">
<a href="shu1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">图片跟随鼠标
</a><br>
<a href="shu2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">鼠标响应新页
面</a><br>
<a href="shu3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">禁用鼠标左右
键</a><br>
<a href="shu4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">鼠标控制窗口
开关</a><br>
<a href="picture6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">鼠标点击
效果</a><br>
<a href="shu5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">禁用右键自动
导航</a><br>
<a href="shu6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">鼠标激活警告
框</a>
</div>
<div id="KB8Parent" class="parent"><a href="#" onClick="expandIt(@#KB8@#); return
false">
<img SRC="plus.gif" BORDER="0">Cookie脚本</a></div><div id="KB8Child" class="chi
ld">
<a href="cook1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">随登陆次数
变提示</a><br>
<a href="cook2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">集成Cookie
s</a><br>
<a href="cook3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">使窗口仅弹
出一次</a><br>
<a href="cook4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">签名提示程
序</a><br>
<a href="cook5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">记录上次登
录时间</a><br>
<a href="cook6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">自由控制打
开窗口</a><br>
<a href="cook7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">记录页面修
改时间</a><br>
<a href="cook8.htm" target="_target"> <img SRC="blank.gif" BORDER="0">检测IE去过
站点</a><br>
<a href="cook9.htm" target="_target"> <img SRC="blank.gif" BORDER="0">离开时显示
信息</a><br>
<a href="cook10.htm" target="_target"> <img SRC="blank.gif" BORDER="0">弹出窗口自
动关闭</a><br>
<a href="cook11.htm" target="_target"> <img SRC="blank.gif" BORDER="0">离开页面弹
出窗口</a><br>
<a href="cook12.htm" target="_target"> <img SRC="blank.gif" BORDER="0">进入时显示
信息</a></div>
<div id="KB9Parent" class="parent"><a href="#" onClick="expandIt(@#KB9@#); return
false">
<img SRC="plus.gif" BORDER="0">文本特效类</a></div><div id="KB9Child" class="chi
ld">
<a href="text1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">随机信息显
示</a><br>
<a href="text2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">随机文本链
接</a><br>
<a href="text3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">所有链接不
停变色</a><br>
<a href="text4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">鼠标经过文
字变色</a><br>
<a href="text5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">随日期变换
文本</a><br>
<a href="ye9.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文字颜色渐变
脚本</a><br>
<a href="ye5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文本自动输出
</a></div>
<div id="KB10Parent" class="parent"><a href="#" onClick="expandIt(@#KB10@#); retur
n false">
<img SRC="plus.gif" BORDER="0">状态栏特效</a></div><div id="KB10Child" class="ch
ild">
<a href="ye8.htm" target="_target"> <img SRC="blank.gif" BORDER="0">状态栏跑马灯
脚本</a><br>
<a href="zhuang1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文字从右
弹出</a><br>
<a href="zhuang2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文字从左
依次弹出</a><br>
<a href="zhuang3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文字从右
到左移动</a><br>
<a href="zhuang4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文字快速
依次弹出</a><br>
<a href="zhuang5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文字组合
弹出</a><br>
<a href="zhuang6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文字不停
闪烁</a><br>
<a href="zhuang7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">状态栏显
示链接</a><br>
<a href="time9.htm" target="_blank"> <img SRC="blank.gif" BORDER="0">title显示日
期</a><br>
<a href="zhuang8.htm" target="_blank"> <img SRC="blank.gif" BORDER="0">title变化
弹出</a></div>
<div id="KB11Parent" class="parent"><a href="#" onClick="expandIt(@#KB11@#); retur
n false">
<img SRC="plus.gif" BORDER="0">密 码 类</a></div><div id="KB11Child" class="ch
ild">
<a href="password1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">控制他
人进入页面</a><br>
<a href="password3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">用来实
现会员制度</a><br>
<a href="password4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">密码保
护相应页面</a><br><a href="password5.htm" target="_target"> <img SRC="blank.gif"
BORDER="0">自己编制密码表</a></div>
<div id="KB12Parent" class="parent"><a href="#" onClick="expandIt(@#KB12@#); retur
n false">
<img SRC="plus.gif" BORDER="0">综 合 类</a></div><div id="KB12Child" class="ch
ild">
<a href="zh1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">加密页面源代
码</a><br>
<a href="zh2.htm" target="_target"> <img SRC="blank.gif" BORDER="0">访问时间限制
</a><br>
<a href="zh3.htm" target="_target"> <img SRC="blank.gif" BORDER="0">给页面加“热
键”</a><br>
<a href="zh4.htm" target="_target"> <img SRC="blank.gif" BORDER="0">两个脚本同时
调用</a><br>
<a href="zh5.htm" target="_target"> <img SRC="blank.gif" BORDER="0">浏览器毁灭者
</a><br>
<a href="zh6.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文本中首字母
大写</a><br>
<a href="zh7.htm" target="_target"> <img SRC="blank.gif" BORDER="0">查看某网址源
代码</a><br>
<a href="zh8.htm" target="_target"> <img SRC="blank.gif" BORDER="0">文本中首字母
大写</a><br>
<a href="zh9.htm" target="_target"> <img SRC="blank.gif" BORDER="0">加快图片显示
</a><br>
<a href="zh10.htm" target="_target"> <img SRC="blank.gif" BORDER="0">综合的搜索引
擎</a><br>
<a href="zh11.htm" target="_target"> <img SRC="blank.gif" BORDER="0">搜索引擎登记
</a><br>
<a href="zh12.htm" target="_target"> <img SRC="blank.gif" BORDER="0">下载记时器脚
本</a>
</div>
<div id="KB13Parent" class="parent"><a href="#" onClick="expandIt(@#KB13@#); retur
n false">
<img SRC="plus.gif" BORDER="0">游 戏 类</a></div><div id="KB13Child" class="ch
ild">
<a href="you1.htm" target="_target"> <img SRC="blank.gif" BORDER="0">一款流行
游戏
</a></div>
<script>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@#;score
s[14]=@#KB13@#;</script
原文转自:http://www.ltesting.net