要完成此效果需要三個(gè)步驟
第一步:把如下代碼加入到區(qū)域中
第二步:把如下代碼加入到區(qū)域中
<script language="JavaScript">
var regel = 0; //row to start with
var size = 20; //size of font
var delay = 1200; //Delay between messages in msecs
var speed = 20; //Hmmmmmm
var step = 10; //Size of each step
var sent = new Array()
{
sent[0] = "歡迎光臨jojoo.net!";
sent[1] = "本站實(shí)例大多來自國外JS站點(diǎn)";
sent[2] = "加拿大.日本.美國.歐洲最多!";
sent[3] = "每天都有全新的JS實(shí)例提供給您";
sent[4] = "鎖定本站給您最新及最好的資料";
sent[5] = "JavaScript Fairyland!";
}
sent[sent.length] = sent[0];var veran = 0;var num = 0;var x = 0;//Don't change
function moto(){output = "";for(letter = 0;letter
size)gr=size;
output += ""+sent[regel+x].substring(letter, letter+1)+"";
if(num < 0 && x==1){veran++;x=0;}}else{if(veran > letter){
output += ""+sent[regel+1].substring(letter, letter+1)+"";
}else{output += ""+sent[regel].substring(letter, letter+1)+"";}}}
return output;}function startmot(){if(regel==sent.length-1)regel=0;balk.innerHTML = moto();
if(veran==sent[regel+1].length){regel++;veran = 0;setTimeout("startmot()", delay);}else{
setTimeout("startmot()", speed);}}
</script>
第三步:把“onload="startmot()"”加在標(biāo)記里
例如: