联系我们

地址:黑龙江省哈尔滨市南岗区文库街16号智力大厦208室
邮编:150040
业务咨询办理:
——座机:0451-89060603
——手机:013945010420
电话总机:0451-86230075 86230073
传真:拨通总机转608
网站教学 QQ:499485031
网站教学 QQ:498760590
业务咨询 QQ:470030788
[ MSN:ourservice@hotmail.com ]

文章内容
飞舞的文字页面
2008年03月28日 08:40    点击数:         
打印本页 收藏 关闭 【字号
导读:

说明

数字在页面上飞舞

效果

看一下就知道了

代码

<script language="JavaScript" type="text/javascript">
<!--
if (document.all){
xL=5;
xH=0;
xW=0;
xR=0;
xE=0;
xMY=0;
xMX=0;
xWd=0;
xHd=0;
xF=new Array();
xY=new Array();
xX=new Array();
xS=new Array();
xA=new Array();
xB=new Array();
ini=new Array();
cl=new Array('#fff000','#0000FF','#ff0000','#00ff00','#ff00ff','#ffa500')
document.write('<div id="xouter" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < xL; i++){
document.write('<div id="xie" style="position:absolute;top:0;left:0;width:10px;height:10px;'
+'font-family:Courier New;font-size:50px;color:#ffffff">'+Math.round(Math.random()*9)+'</div>');
}
document.write('</div></div>');
//Initial Placement!
function Set(){
for (i=0; i < xL; i++){
xH=window.document.body.offsetHeight;
xW=window.document.body.offsetWidth;
xA[i]=Math.round(Math.random()*xH);
xB[i]=Math.round(Math.random()*xW);
xS[i]=Math.random()*0.07+0.05;
xR=Math.round(Math.random()*3);
xE=Math.round(Math.random()*2500+50)
if (xR == 3) xB[i]=-xE;
if (xR == 2) xB[i]=xW+xE;
if (xR == 1) xA[i]=-xE;
if (xR == 0) xA[i]=xH;
xF[i]=xW/14;
}
}
Set();
function Assign(){
xouter.style.top=document.body.scrollTop;
for (i=0; i < xL; i++){
xF[i]-=xS[i]*50;
if (xF[i] < 4) xF[i]=3;
xie[i].style.top =xY[i];
xie[i].style.left=xX[i];
xie[i].style.fontSize=xF[i];
xie[i].style.filter='glow(color='+ini[i]+', strength='+xF[i]/3+')';
}
}
function fly(){
var N=Math.floor(Math.random()*cl.length)
xMY=window.document.body.clientHeight/2;
xMX=window.document.body.clientWidth/2;
xWd=Math.round(Math.random()*40+5);
xHd=Math.round(Math.random()*30+5);
for (i=0; i < xL; i++)
{
xY[i]=xA[i]+=(xMY-xA[i])*(xS[i]);
xX[i]=xB[i]+=(xMX-xB[i])*(xS[i]);
if ((xX[i] > xMX-xWd) && (xX[i] < xMX+xWd) && (xY[i] > xMY-xHd) && (xY[i] < xMY+xHd)){

xH=window.document.body.offsetHeight;
xW=window.document.body.offsetWidth;
xA[i]=Math.round(Math.random()*xH);
xB[i]=Math.round(Math.random()*xW);
xS[i]=Math.random()*0.05+0.05;
xR=Math.round(Math.random()*3);
xE=Math.round(Math.random()*50+50)
if (xR == 3) xB[i]=-xE;
if (xR == 2) xB[i]=xW+xE;
if (xR == 1) xA[i]=-xE;
if (xR == 0) xA[i]=xH+xE;
}
if ((xX[i] < 0) || (xX[i] > xW) || (xY[i] < 0) || (xY[i] > xH))
{
xF[i]=xW/14;
ini[i]=cl[N];
}
}
Assign();
setTimeout('fly()',10);
}
fly();
}
// -->
</script>



Copyright © 2000 - 2011┊Sumly Soft, All Rights Reserved┊三雷科技 版权所有┊Email:harbin@126.com┊公司简介

地址:黑龙江省哈尔滨市南岗区文库街16号智力大厦208室┊邮编:150040

业务咨询办理:0451-89060603、013945010420┊电话总机:0451-86230075 86230073┊传真:拨通总机转608

[网站教学 QQ:499485031┊网站教学498760590┊业务咨询470030788]┊[ MSN:ourservice@hotmail.com ]

黑B2-20040341

全球最专业的多语言大型商业社区系统 - 三雷软件
本商业网站系统由哈尔滨三雷科技有限公司开发提供
powered by sumly! cms 6.0.0 © 2000 - 2008 30t.com inc.
the most professional multilanguage commercial community developer - sumly