javascript特效--数字下落
来源:互联网 发布:java类的继承 编辑:程序博客网 时间:2024/04/20 13:37
第一步:把如下代码加入<body>区域中
<script language="JavaScript">
<!--
if (document.all){
Cols=6;
Cl=24;//Space's are included so real length is 48!
Cs=10;
Ts=10;
Tc='#008800';
Tc1='#00ff00';
MnS=20;
MxS=30;
I=Cs;
Sp=new Array();S=new Array();Y=new Array();
C=new Array();M=new Array();B=new Array();
RC=new Array();E=new Array();Tcc=new Array(0,1);
document.write("<div id='Container' style='position:absolute;top:0;left:-"+Cs+"'>");
document.write("<div style='position:relative'>");
for(i=0; i < Cols; i++){
S[i]=I+=Cs;
document.write("<div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"
+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden'></div>");
}
document.write("</div></div>");
for(j=0; j < Cols; j++){
RC[j]=1+Math.round(Math.random()*Cl);
Y[j]=0;
Sp[j]=Math.round(MnS+Math.random()*MxS);
for(i=0; i < RC[j]; i++){
B[i]='';
C[i]=Math.round(Math.random()*1)+' ';
M[j]=B[0]+=C[i];
}
}
function Cycle(){
Container.style.top=window.document.body.scrollTop;
for (i=0; i < Cols; i++){
var r = Math.floor(Math.random()*Tcc.length);
E[i] = '<font color='+Tc1+'>'+Tcc[r]+'</font>';
Y[i]+=Sp[i];
if (Y[i] > window.document.body.clientHeight){
for(i2=0; i2 < Cols; i2++){
RC[i2]=1+Math.round(Math.random()*Cl);
for(i3=0; i3 < RC[i2]; i3++){
B[i3]='';
C[i3]=Math.round(Math.random()*1)+' ';
C[Math.floor(Math.random()*i2)]=' '+' ';
M[i]=B[0]+=C[i3];
Y[i]=-Ts*M[i].length/1.5;
A[i].style.visibility='visible';
}
Sp[i]=Math.round(MnS+Math.random()*MxS);
}
}
A[i].style.top=Y[i];
A[i].innerHTML=M[i]+' '+E[i]+' ';
}
setTimeout('Cycle()',20)
}
Cycle();
}
// -->
</script>
第二步:把如下代码加入<body>区域中<body bgcolor=black>
- javascript特效--数字下落
- javaScript特效--0,1数字下落
- <Web>jQuery黑客帝国,数字下落特效!
- 数字下落
- javascript特效
- javascript特效
- javascript特效
- JavaScript特效
- javascript特效
- javascript特效
- javascript-特效
- 下落
- 高级UI特效之酷炫抢红包金币下落动画
- 【特效】滚动的数字
- 数字滚动特效
- canvas数字特效
- Start MSN特效(JavaScript)
- JavaScript特效集
- JAVA中ThreadLocal使用三
- 让系统更快更稳定九大技巧
- 读研究生和蹲监狱的区别 转自人人
- Ubuntu中配置LaTeX中文的方法
- 西方哲学简史
- javascript特效--数字下落
- 30秒清除你电脑中的垃圾
- 暑假实训第五天
- 开机速度优化
- c++ primer上的一个错误
- 强调企业与外部的交易与合作
- 一个Java程序员应该掌握的10项技能
- How to write good essay
- myeclipse Resin自动部署