中文(繁体)
<!--要完成此效果需要兩個步驟第一步:把如下程式碼加入<head>區域中--> <SCRIPT language="JavaScript"> <!-- function scrollit(seed) { var m1 = "HI:你好! "; var m2 = "歡迎訪問網頁教學網"; var m3 = "請多提意見,謝謝! "; var msg=m1+m2+m3; var out = " "; var c = 1; if (seed > 100) { seed--; cmd="scrollit("+seed+")"; timerTwo=window.setTimeout(cmd,100); } else if (seed <= 100 && seed > 0) { for (c=0 ; c < seed ; c++) { out+=" "; } out+=msg; seed--; window.status=out; cmd="scrollit("+seed+")"; timerTwo=window.setTimeout (cmd,100); } else if (seed <= 0) { if (-seed < msg.length) { out+=msg.substring(-seed,msg.length); seed--; window.status=out; cmd="scrollit("+seed+")"; timerTwo=window.setTimeout(cmd,100); } else { window.status=" "; timerTwo=window.setTimeout("scrollit(100)",75); } } } //--> </SCRIPT> <!--第二步:把「onLoad="scrollit(100)"」加在<body>標記裡--> <body onLoad="scrollit(100)" >