不知道妳所期待的效果是怎樣的,以下是改寫後套樣的代碼。
這裏是給 tu-text 加了壹個ID aa,如果妳是必須針對class,那自己增加壹個for循環吧
Phrase?=?document.getElementById('aa');Nb?=?Phrase.children.length;
Taille?=?40;
Midx?=?100;
Decal?=?0.5;
y?=?-10000;
Alpha=5; I_Alpha=0.05; function?Alors(){??Alpha=Alpha-I_Alpha;
?for?(x=0;x<Nb;x++){?
?Alphal=Alpha+Decal*x;?
?Cosine=Math.abs(Math.cos(Alphal));
?ob=Phrase.children[x];
?ob.style.zIndex=Math.round(20*Cosine);
?ob.style.fontSize=Taille+25*Cosine+"px";
?ob.style.color="rgb("+?(27+Math.round(Cosine*80)+50)?+?","+?(127+Math.round(Cosine*80)+50)?+?",0)";
?}
} Time=window.setInterval("Alors()",10);