<html>
<title>实例13</title>
<body>
<script language=javascript>
message="旋转的文字"
Balises=""
Taille=40;
Midx=40;
Decal=0.5;
num=message.length;
y=-1000;
for (x=0;x<num;x++)
{Balises=Balises + '<DIV Id=L' + x + ' STYLE="width:4;font-family: 宋体; font-weight:bold;position:absolute;top:100;left:100">' + message.charAt(x) + '</DIV>'
}
document.write (Balises);
Time=window.setInterval("Alors()",10);
Alpha=5;
I_Alpha=0.05;
function Alors()
{Alpha=Alpha-I_Alpha;
for(x=0;x<num;x++)
{Alpha1=Alpha+Decal*x;
Cosine=Math.cos(Alpha1);
Ob=document.all("L"+x);
Ob.style.posLeft=Midx+100*Math.sin(Alpha1)+260;
Ob.style.zIndex=10*Cosine;
Ob.style.fontSize=Taille+25*Cosine;
Ob.style.color="rgb("+ (20+Cosine*80+150) + ","+ (227+Cosine*80+250) + ",0)";
}
}
</script>
</body>
</html>
<title>实例13</title>
<body>
<script language=javascript>
message="旋转的文字"
Balises=""
Taille=40;
Midx=40;
Decal=0.5;
num=message.length;
y=-1000;
for (x=0;x<num;x++)
{Balises=Balises + '<DIV Id=L' + x + ' STYLE="width:4;font-family: 宋体; font-weight:bold;position:absolute;top:100;left:100">' + message.charAt(x) + '</DIV>'
}
document.write (Balises);
Time=window.setInterval("Alors()",10);
Alpha=5;
I_Alpha=0.05;
function Alors()
{Alpha=Alpha-I_Alpha;
for(x=0;x<num;x++)
{Alpha1=Alpha+Decal*x;
Cosine=Math.cos(Alpha1);
Ob=document.all("L"+x);
Ob.style.posLeft=Midx+100*Math.sin(Alpha1)+260;
Ob.style.zIndex=10*Cosine;
Ob.style.fontSize=Taille+25*Cosine;
Ob.style.color="rgb("+ (20+Cosine*80+150) + ","+ (227+Cosine*80+250) + ",0)";
}
}
</script>
</body>
</html>
message = "旋转的文字"
Balises = ""
Taille = 40;
Midx = 40;
Decal = 0.5;
num = message.length;
y = -1000;
for (x = 0; x < num; x++) {
Balises = Balises
+ ' <DIV Id=L'
+ x
+ ' STYLE="width:4;font-family: 宋体; font-weight:bold;position:absolute;top:100;left:100">'
+ message.charAt(x) + ' </DIV>'
}
document.write(Balises);
Time = window.setInterval("Alors()", 10);
Alpha = 5;
I_Alpha = 0.05;
function Alors() {
Alpha = Alpha - I_Alpha;
for (x = 0; x < num; x++) {
Alpha1 = Alpha + Decal * x;
Cosine = Math.cos(Alpha1);
Ob = document.getElementById("L" + x);
Ob.style.left = (Midx + 100 * Math.sin(Alpha1) + 260)+'px';
Ob.style.zIndex = 10 * Cosine;
Ob.style.fontSize = Taille + 25 * Cosine;
Ob.style.color = "rgb(" + (20 + Cosine * 80 + 150) + ","
+ (227 + Cosine * 80 + 250) + ",0)";
}
}
Balises = ""
Taille = 40;
Midx = 40;
Decal = 0.5;
num = message.length;
y = -1000;
for (x = 0; x < num; x++) {
Balises = Balises
+ ' <DIV Id=L'
+ x
+ ' STYLE="width:4;font-family: 宋体; font-weight:bold;position:absolute;top:100;left:100">'
+ message.charAt(x) + ' </DIV>'
}
document.write(Balises);
Time = window.setInterval("Alors()", 10);
Alpha = 5;
I_Alpha = 0.05;
function Alors() {
Alpha = Alpha - I_Alpha;
for (x = 0; x < num; x++) {
Alpha1 = Alpha + Decal * x;
Cosine = Math.cos(Alpha1);
Ob = document.getElementById("L" + x);
Ob.style.left = (Midx + 100 * Math.sin(Alpha1) + 260)+'px';
Ob.style.zIndex = 10 * Cosine;
Ob.style.fontSize = (Taille + 25 * Cosine)+'px';
Ob.style.color = "rgb(" + (20 + Cosine * 80 + 150) + ","
+ (227 + Cosine * 80 + 250) + ",0)";
}
}