文字颜色不断移动变化

发布时间:2011年1月10日 作者:未知 查看次数:2177

文字颜色不断移动变化


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>sieye *山西.襄垣</title>
</head>
<body>
<br><br><!--下面为演示代码-->
<p align="center"><font color="#0080FF" size="5">文字颜色移动变化</font></p>

<script language="JavaScript">
<!--
var color5=0;
var color0=0;
var divleft=100;
var mycolor="#000000"
function getnum(num){
 if (num<10){return num;}
 else{ if(num==10)return "A";
  if(num==11)return "B";
  if(num==12)return "C";
  if(num==13)return "D";
  if(num==14)return "E";
  if(num==15)return "F";
 }
}
function colorchan(text){
 for(i=0;i<text.length;i++){
 divleft=divleft+18;
 document.write("<div id=my"+i+" style='position:absolute;width:10;height:5;left:"+divleft+";top:400;color:"+mycolor+"'>"+text.substring(i,i+1)+"</div>");
 }
}
function divchan(text){
for(m=0;m<text.length;m++){
c=m+color0;
if(c>15)c=c-15;
cc=2*c+m;
while(cc>15)cc=cc-15;
ccc=3*c;
while(ccc>15)ccc=ccc-15;
color1=getnum(c);
color2=getnum(cc);
color3=getnum(ccc);
color4=getnum(color0);
mycolor=color5+"F"+color3+color4+color1+color2;
if(m==0)document.all.my0.style.color=mycolor;
if(m==1)document.all.my1.style.color=mycolor;
if(m==2)document.all.my2.style.color=mycolor;
if(m==3)document.all.my3.style.color=mycolor;
if(m==4)document.all.my4.style.color=mycolor;
if(m==5)document.all.my5.style.color=mycolor;
if(m==6)document.all.my6.style.color=mycolor;
if(m==7)document.all.my7.style.color=mycolor;
if(m==8)document.all.my8.style.color=mycolor;
if(m==9)document.all.my9.style.color=mycolor;
<!--请另添加-->
}
color0++;
color5++;
if(color0>15)color0=0;
if(color5>9)color5=0;
setTimeout("divchan(mytext)",100);
}
-->
</script>
<script language="javascript">
mytext="颜色移动变化的文字:sieye电脑爱好家园";
colorchan(mytext);
divchan(mytext);
</script>


<br><br><!--以上为演示代码-->

<p align="right"><a href="http://www.sieye.cn">人之初 电脑爱号家园</a><br>山西.襄垣 </p><br><br><br><br>

</body>
</html>



版权所有!www.sieye.cn
E.Mail:sieye@sohu.com QQ:66697110