js数字下落特效代码
js数字下落特效代码
实现特效的代码js【相关标签:特效 数字下落 】
数字下落特效
<html xmlns="/1999/xhtml">
<head>
<title>数字下落特效 </title>
</head>
<body bgcolor=black>
<script language="JavaScript">
<!-- Matrix by *********************
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]=und(Math.random()*Cl);
Y[j]=0;
Sp[j]=und(MnS+Math.random()*MxS);
for(i=0; i < RC[j]; i++){
B[i]=’’;
C[i]=und(Math.random()*1)+’ ’;
M[j]=B[0]+=C[i];
}
}
function Cycle(){
p=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]=und(Math.random()*Cl);
for(i3=0; i3 < RC[i2]; i3++){
B[i3]=’’;
C[i3]=und(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]=und(MnS+Math.random()*MxS);
}
}
A[i].p=Y[i];
A[i].innerHTML=M[i]+’ ’+E[i]+’ ’;
}
setTimeout(’Cycle()’,20)
}
Cycle();
}
// -->
</script>
</body>
</html>
js数字下落特效代码
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论