想必不少好手都會了~
轉貼分享出來給想知道的新朋友們~
展示跟本文
代碼: 選擇全部
<div id="fade" style="width: 200; text-align: center; height: 19"></div>
<script type="text/javascript">
<!--
function fadetext() {
fade.style.filter="alpha(opacity="+x+", style=0)";
x=((y<50)?x+4:x-4); y+=2;
if(y==100) {
z=((z>=texts.length-1)?1:z+1); y=0;
fade.innerHTML=texts[z]; fade.style.color=tcolor[z];
}
setTimeout("fadetext();", 10);
}
var texts=new Array(3), tcolor=new Array(3), x=0, y=0, z=1;
texts[1]="歡迎光臨迷惘謎網!";
texts[2]="這是這是文字漸層效果!";
texts[3]="喜歡就複製回去喔 ! ";
tcolor[1]="#227700";
tcolor[2]="#ff44aa";
tcolor[3]="#ffbb00";
fade.innerHTML=texts[z]; fade.style.color=tcolor[z];
window.onload=fadetext;
//-->
</script>鳥級的~

