148、文字显示精彩特效

148、文字显示精彩特效

脚本说明:

第一步:把如下代码加入<body>区域中

<STYLE>

.let {

       COLOR: white; FILTER: Shadow (Color="#6699CC", Direction="135")wave(Add="0", Phase="4", Freq="9", LightStrength="20", Strength="1"); FONT-FAMILY: Verdana; FONT-WEIGHT: bold; WIDTH: 500px

}

</STYLE>

<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] = "欢迎光临7stk";

sent[1] = "本站有超过500种的javascript特效";

sent[2] = "这些特效主要是来自国外的一些相关站点";

sent[3] = "每星期都有15种左右的特效与您见面";

sent[4] = "只要你经常光临,就一定会有收获的!";

sent[5] = "JavaScript再次谢谢你的光临!";

}

 

sent[sent.length] = sent[0];var veran = 0;var num = 0;var x = 0;//Don't change

function moto(){output = "";for(letter = 0;letter<sent[regel+1].length;letter++){

if(veran == letter){if(x==0){num=num+step;}else{num=num-step;}gr = size-num;

if(gr < 1){x=1;gr=1;}if(gr>size)gr=size;

output += "<font style='font-size:"+gr +"pt'>"+sent[regel+x].substring(letter, letter+1)+"</font>";

if(num < 0 && x==1){veran++;x=0;}}else{if(veran > letter){

output += "<font style='font-size:"+size +"pt'>"+sent[regel+1].substring(letter, letter+1)+"</font>";

}else{output += "<font style='font-size:"+size +"pt'>"+sent[regel].substring(letter, letter+1)+"</font>";}}}

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>

 

<TABLE align=center bgColor=#008000 height=60 id=tafel

onclick='location="http://www.7stk.com"' style="CURSOR: hand"

  width=500><TBODY>

  <TR>

    <TD bgColor=#ff6666>

      <DIV align=center class=let id=balk></DIV></TD></TR></TBODY></TABLE>

 

 

第二步:把<body>中的内容改为:

<body onload=startmot()>

 

Write a comment

Comments: 0