Js 实现文字爬楼滚动效果 结合文本框
作者:bea
<html> <head> <title>文字爬楼</title> </head><body> <SCRIPT language=JavaScript> msg="网页特效" align="left"; speed=250; up=true; spas=" "; for (a=0;a<=12;a++) {spas+=" "} msg=spas+msg+spas; j=eval(-1);
<html>
<head>
<title>文字爬楼</title>
</head><body>
<SCRIPT language=JavaScript>
msg="网页特效"
align="left";
speed=250;
up=true;
spas=" ";
for (a=0;a<=12;a++) {spas+=" "}
msg=spas+msg+spas;
j=eval(-1);
stop=msg.length;
document.write("<form name='form'><table border=0 cellspacing=0 "
+"cellpadding=0 align="+align+">");
for (i=1;i<=13;i++) {
document.write("<tr><td><input type=text name="box"+i+"" size=1>");
document.write("</td></tr>");
}
document.write("</table></form>");
function scrollIt() {
j++;
with (document.form) {
if ((j+12) <= stop) {
box1.value = msg.charAt(j);
box2.value = msg.charAt(j+1);
box3.value = msg.charAt(j+2);
box4.value = msg.charAt(j+3);
box5.value = msg.charAt(j+4);
box6.value = msg.charAt(j+5);
box7.value = msg.charAt(j+6);
box8.value = msg.charAt(j+7);
box9.value = msg.charAt(j+8);
box10.value = msg.charAt(j+9);
box11.value = msg.charAt(j+10);
box12.value = msg.charAt(j+11);
box13.value = msg.charAt(j+12);
} else {
j=0;
}
}
setTimeout("scrollIt()",speed);
}
scrollIt();
// End -->
</SCRIPT>
</body>
</html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- 再谈ie和firefox下的document.all属性
- 用Javascript 编写可以缓慢弹出收缩的层
- javascript void(0)的妙用
- extjs 学习笔记 四 带分页的grid
- Jquery Ajax.ashx 高效分页实现代码
- fireworks菜单生成器mm_menu.js在 IE 7.0 显示问题的解决方法
- Javascript remove 自定义数组删除方法
- JavaScript 事件记录使用说明
- 7个Javascript地图脚本整理
- JavaScript 自动完成脚本整理(33个)
- javascript 添加和移除函数的通用方法
- JS 用6N±1法求素数 实例教程
- 获取网站跟路径的javascript代码(站点及虚拟目录)
- JavaScript 点击插入文字
- 单选按钮决定链接的网址
- 让链接必须按先后顺序点击的JS代码
- Js文字背景行如流水特效
- 一个链接按两种方式打开两个网址的方法
- 随日期每天自动变换的文本的js特效