?? 47.html
字號(hào):
<html>
<head>
<title>不斷轉(zhuǎn)動(dòng)的文字</title>
<SCRIPT language=JavaScript>
<!--
if (document.all){
msg=" *** 不斷轉(zhuǎn)動(dòng) 不停的轉(zhuǎn)動(dòng)"; //設(shè)置轉(zhuǎn)動(dòng)內(nèi)容
msgColor="red"; //設(shè)置文字顏色
msgFont="Arial"; //設(shè)置文字字體
msg=msg.split('');
n=msg.length;
e=360/n;
yp=110;
xp=110;
yb=40; //設(shè)置以隱藏基線為基準(zhǔn)的垂直坐標(biāo)
xb=80; //設(shè)置以隱藏基線的寬度
sa=0.06;
sb=100;
pa=new Array();
pb=new Array();
for (i=0; i < n; i++){
document.write('<div id="txtaress" style="position:absolute;top:0;left:0;'
+'height:0;width:0;font-family:'+msgFont+';text-align:center;color:'+msgColor+'">'+msg[i]+'</div>');
}
function ani(){
yp=document.body.scrollTop+100; //設(shè)置圓心的縱坐標(biāo)
xp=document.body.scrollLeft+window.document.body.clientWidth-400; //設(shè)置圓心的橫坐標(biāo)
for (i=0; i < n; i++){
txtaress[i].style.top =yp+yb*Math.sin(sb+i*e*Math.PI/180);
txtaress[i].style.left=xp+xb*Math.cos(sb+i*e*Math.PI/180);
pb[i]=txtaress[i].style.pixelTop-yp;
pa[i]=pb[i]-pb[i]*2;
if (pa[i] < 1){
pa[i]=0;
txtaress[i].style.visibility='hidden';
}
else txtaress[i].style.visibility='visible';
txtaress[i].style.fontSize=pa[i]/2.7;
}
sb-=sa;
setTimeout('ani()',60); //設(shè)置轉(zhuǎn)動(dòng)的速度
}
window.onload=ani;
}
// -->
</SCRIPT>
</head>
<body>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -