设计之家 > 教程 > 網頁教程 > 其他教程 >

文字特效處理

作者:未知 來源:本站原創 時間:2006-03-08

1、波浪字

<!-- 第 1 步: -->
<!-- 把下面的代碼加到<HEAD></HEAD>區域中: -->

<script>
message="Welcome to foowin.com!"
ns6switch=1

var ns6=document.getElementById&&!document.all
mes=new Array();
mes[0]=-1;
mes[1]=-4;
mes[2]=-7;mes[3]=-10;
mes[4]=-7;
mes[5]=-4;
mes[6]=-1;
num=0;
num2=0;
txt="";
function jump0(){
if (ns6&&!ns6switch){
jump.innerHTML=message
return
}
if(message.length > 6){
for(i=0; i != message.length;i++){
txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
jump.innerHTML=txt;
txt="";
jump1a()
}
else{
alert("http://foowin.com")
}
}

function jump1a(){
nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
nfinal.style.left=-num2;
if(num2 != 9){
num2=num2+3;
setTimeout("jump1a()",50)
}
else{
jump1b()
}
}

function jump1b(){
nfinal.style.left=-num2;
if(num2 != 0){num2=num2-3;
setTimeout("jump1b()",50)
}
else{
jump2()
}
}

function jump2(){
txt="";
for(i=0;i != message.length;i++){
if(i+num > -1 && i+num < 7){
txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"
}
else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
}
jump.innerHTML=txt;
txt="";
if(num != (-message.length)){
num--;
setTimeout("jump2()",50)}
else{num=0;
setTimeout("jump0()",50)}}
</script>

 


<!-- 第 2 步: -->
<!-- 把下面的代碼加到<BODY></BODY>區域中: -->

<h2><div id="jumpx" style="color:33ff33"></div></h2>
<script>
if (document.all||document.getElementById){
jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpx
jump0()
}
else
document.write(message)
</script>
==================

2、字符順序顯示變化

<!-- 第 1 步: -->
<!-- 把下面的代碼加到<HEAD></HEAD>區域中: -->

<SCRIPT LANGUAGE="ja;vascript">
neonBaseColor = "White";
neonColor = "00ff00";
num = 0;
num2 = 0;
num3 = 0;
num4 = neonColor;
function startNeon() {
message = neon.innerText;
neon.innerText = "";
for(i = 0; i != message.length; i++) {
neon.innerHTML += "<span id=\"neond\" style=\"color:"+neonBaseColor+"\">"+message.charAt(i)+"<\/span>"};
neon2();
}
function neon2() {
if(num != message.length) {
document.all.neond[num].style.color = neonColor;
num++;
setTimeout("neon2()", 100);
}
else {
num = 0;
num2 = message.length;
setTimeout("neon4onev()", 2000);
   }
}
function neon4onev() {
document.all.neond[num].style.color = neonBaseColor;
document.all.neond[num2-1].style.color = neonBaseColor;
if(Math.floor(message.length / 2) + 1 != num2) {
num++;
num2--;
setTimeout("neon4onev()", 50);
}
else {
setTimeout("neon5()", 50);
   }
}
function neon5() {
if(num3 != message.length && num3 != message.length+1) {
document.all.neond[num3].style.color = neonColor;
num3 = num3 + 2;
setTimeout("neon5()",100);
}
else {
setTimeout("neon52()", 50);
   }
}
function neon52() {
if(num3 == message.length) {
num3++;
neon52a();
}
else {
num3--;
neon52a();
   }
}
function neon52a() {
if(num3 != 1) {
num3 = num3 - 2;
document.all.neond[num3].style.color = neonColor;
setTimeout("neon52a()", 100);
}
else {
if(num4 == neonColor) {
num3 = 0;
neonColor = neonBaseColor;
setTimeout("neon5()", 2000);
}
else {
neonColor = num4;
num3 = 0;
setTimeout("neon4onev2()", 50);
      }
   }
}
function neon4onev2() {
document.all.neond[num].style.color = neonColor;
document.all.neond[num2 - 1].style.color = neonColor;
if(message.length != num2) {
num--;
num2++;
setTimeout("neon4onev2()", 50);
}
else {
num = 0;
num2 = 0;
setTimeout("neon3()", 2000);
   }
}
function neon3() {
if(num != message.length) {
document.all.neond[num].style.color = neonBaseColor;
num++;
setTimeout("neon3()", 100);
}
else {
num = 0;
neon2();
   }
}
</script>

 


<!-- 第 2 步: -->
<!-- 把<BODY>中的屬性代碼改為: -->

<BODY onLoad="startNeon()">

 

<!-- 第 3 步: -->
<!-- 把下面的代碼加到<BODY></BODY>區域中: -->

<span id="neon">www.foowin.com</span>
==============================================

3、總在右上角旋轉顯示的字符

<script language="ja;vascript">
if (document.all){
msg="---http://www.foowin.com/";
msgColor="33ff33";
msgFont="Verdana";

msg=msg.split('');
n=msg.length;
e=360/n;
yp=0;
xp=0;
yb=40;
xb=60;
sa=0.07;
sb=0;
pa=new Array();
pb=new Array();
for (i=0; i < n; i++){
document.write('<div id="logo" style="position:absolute;top:0;left:0;'
+'height:30;width:30;font-family:'+msgFont+';text-align:center;color:'+msgColor+'">'+msg[i]+'</div>');
}
function ani(){
yp=document.body.scrollTop+50;
xp=document.body.scrollLeft+window.document.body.clientWidth-100;
for (i=0; i < n; i++){
logo[i].style.top =yp+yb*Math.sin(sb+i*e*Math.PI/180);
logo[i].style.left=xp+xb*Math.cos(sb+i*e*Math.PI/180);
pb[i]=logo[i].style.pixelTop-yp;
pa[i]=pb[i]-pb[i]*2;
if (pa[i] < 1){
pa[i]=0;
logo[i].style.visibility='hidden';
}
else logo[i].style.visibility='visible';
logo[i].style.fontSize=pa[i]/2.7;
}
sb-=sa;
setTimeout('ani()',100);
}
window.onload=ani;
}
</script>
==============

4、會跳舞的文本

<!-- 第 1 步: -->
<!-- 把下面的代碼加到<HEAD></HEAD>區域中: -->

<SCRIPT language=ja;vascript>
<!--
function MM_timelinePlay(tmLnName, myID) {

  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines();
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}
  if (myID == tmLn.ID) {
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j];
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_timelineGoto(tmLnName, fNew, numGotos) {

  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines();
  tmLn = document.MM_Time[tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) {
    sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i];
    if (sprite.charAt(0) == "s") {
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames[0];
      lastKeyFr = sprite.keyFrames[numKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue;
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
      for (j=0; j<sprite.values.length; j++) {
        props = sprite.values[j];
        if (numKeyFr == props.length) propNum = keyFrm-1
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1);
        if (sprite.obj != null) {
          if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
          else        sprite.obj[props.prop2][props.prop] = props[propNum];
      } }
    } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  }
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}

function MM_initTimelines() {
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(8);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 10;
    document.MM_Time[0][0] = new String("sprite");
    document.MM_Time[0][0].slot = 1;
    if (ns)
        document.MM_Time[0][0].obj = document["Layer1"];
    else
        document.MM_Time[0][0].obj = document.all ? document.all["Layer1"] : null;
    document.MM_Time[0][0].keyFrames = new Array(2, 6, 9, 12, 15, 18);
    document.MM_Time[0][0].values = new Array(4);
    document.MM_Time[0][0].values[0] = new Array(263,264,265,266,268,268,268,268,271,272,273,270,268,266,265,264,263);
    document.MM_Time[0][0].values[0].prop = "left";
    document.MM_Time[0][0].values[1] = new Array(101,95,89,82,76,87,98,108,100,93,86,91,96,100,102,104,106);
    document.MM_Time[0][0].values[1].prop = "top";
    if (!ns) {
        document.MM_Time[0][0].values[0].prop2 = "style";
        document.MM_Time[0][0].values[1].prop2 = "style";
    }
    document.MM_Time[0][0].values[2] = new Array(58,54,50,46,43,33,24,15,20,25,31,36,41,47,48,49,50);
    document.MM_Time[0][0].values[2].prop = "width";
    if (!ns)
        document.MM_Time[0][0].values[2].prop2 = "style";
    document.MM_Time[0][0].values[3] = new Array(52,51,50,49,48,46,44,42,43,44,45,46,47,49,48,47,47);
    document.MM_Time[0][0].values[3].prop = "height";
    if (!ns)
        document.MM_Time[0][0].values[3].prop2 = "style";
    document.MM_Time[0][1] = new String("sprite");
    document.MM_Time[0][1].slot = 2;
    if (ns)
        document.MM_Time[0][1].obj = document["Layer2"];
    else
        document.MM_Time[0][1].obj = document.all ? document.all["Layer2"] : null;
    document.MM_Time[0][1].keyFrames = new Array(2, 5, 9, 12, 15, 18);
    document.MM_Time[0][1].values = new Array(2);
    document.MM_Time[0][1].values[0] = new Array(323,323,322,322,322,322,322,323,324,326,328,326,324,322,322,322,323);
    document.MM_Time[0][1].values[0].prop = "left";
    document.MM_Time[0][1].values[1] = new Array(126,120,115,111,110,111,111,111,108,105,101,105,109,113,117,122,126);
    document.MM_Time[0][1].values[1].prop = "top";
    if (!ns) {
        document.MM_Time[0][1].values[0].prop2 = "style";
        document.MM_Time[0][1].values[1].prop2 = "style";
    }
    document.MM_Time[0][2] = new String("sprite");
    document.MM_Time[0][2].slot = 3;
    if (ns)
        document.MM_Time[0][2].obj = document["Layer4"];
    else
        document.MM_Time[0][2].obj = document.all ? document.all["Layer4"] : null;
    document.MM_Time[0][2].keyFrames = new Array(2, 5, 9, 12, 15, 18);
    document.MM_Time[0][2].values = new Array(3);
    document.MM_Time[0][2].values[0] = new Array(363,363,363,363,363,363,363,363,365,366,368,366,364,363,363,363,363);
    document.MM_Time[0][2].values[0].prop = "left";
    document.MM_Time[0][2].values[1] = new Array(131,123,115,107,113,119,125,131,122,111,101,113,124,131,131,131,131);
    document.MM_Time[0][2].values[1].prop = "top";
    if (!ns) {
        document.MM_Time[0][2].values[0].prop2 = "style";
        document.MM_Time[0][2].values[1].prop2 = "style";
    }
    document.MM_Time[0][2].values[2] = new Array(22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22);
    document.MM_Time[0][2].values[2].prop = "width";
    if (!ns)
        document.MM_Time[0][2].values[2].prop2 = "style";
    document.MM_Time[0][3] = new String("sprite");
    document.MM_Time[0][3].slot = 4;
    if (ns)
        document.MM_Time[0][3].obj = document["Layer5"];
    else
        document.MM_Time[0][3].obj = document.all ? document.all["Layer5"] : null;
    document.MM_Time[0][3].keyFrames = new Array(2, 5, 9, 12, 15, 18);
    document.MM_Time[0][3].values = new Array(2);
    document.MM_Time[0][3].values[0] = new Array(388,390,391,393,392,391,390,388,390,394,398,397,395,393,390,389,388);
    document.MM_Time[0][3].values[0].prop = "left";
    document.MM_Time[0][3].values[1] = new Array(131,128,124,121,124,126,129,131,119,103,86,105,122,136,137,134,131);
    document.MM_Time[0][3].values[1].prop = "top";
    if (!ns) {
        document.MM_Time[0][3].values[0].prop2 = "style";
        document.MM_Time[0][3].values[1].prop2 = "style";
    }
    document.MM_Time[0][4] = new String("sprite");
    document.MM_Time[0][4].slot = 5;
    if (ns)
        document.MM_Time[0][4].obj = document["Layer6"];
    else
        document.MM_Time[0][4].obj = document.all ? document.all["Layer6"] : null;
    document.MM_Time[0][4].keyFrames = new Array(2, 5, 9, 12, 15, 18);
    document.MM_Time[0][4].values = new Array(2);
    document.MM_Time[0][4].values[0] = new Array(413,413,413,413,413,413,413,413,415,416,418,416,414,413,413,413,413);
    document.MM_Time[0][4].values[0].prop = "left";
    document.MM_Time[0][4].values[1] = new Array(131,124,118,111,116,120,125,131,119,105,91,107,121,131,131,131,131);
    document.MM_Time[0][4].values[1].prop = "top";
    if (!ns) {
        document.MM_Time[0][4].values[0].prop2 = "style";
        document.MM_Time[0][4].values[1].prop2 = "style";
    }
    document.MM_Time[0][5] = new String("sprite");
    document.MM_Time[0][5].slot = 6;
    if (ns)
        document.MM_Time[0][5].obj = document["Layer7"];
    else
        document.MM_Time[0][5].obj = document.all ? document.all["Layer7"] : null;
    document.MM_Time[0][5].keyFrames = new Array(2, 5, 9, 12, 15, 18);
    document.MM_Time[0][5].values = new Array(2);
    document.MM_Time[0][5].values[0] = new Array(433,433,433,433,434,436,437,438,435,432,428,427,427,428,430,431,433);
    document.MM_Time[0][5].values[0].prop = "left";
    document.MM_Time[0][5].values[1] = new Array(131,131,131,131,128,125,120,116,118,120,121,117,112,106,114,122,131);
    document.MM_Time[0][5].values[1].prop = "top";
    if (!ns) {
        document.MM_Time[0][5].values[0].prop2 = "style";
        document.MM_Time[0][5].values[1].prop2 = "style";
    }
    document.MM_Time[0][6] = new String("behavior");
    document.MM_Time[0][6].frame = 19;
    document.MM_Time[0][6].value = "MM_timelineGoto('Timeline1','1')";
    document.MM_Time[0][7] = new String("sprite");
    document.MM_Time[0][7].slot = 7;
    if (ns)
        document.MM_Time[0][7].obj = document["Layer3"];
    else
        document.MM_Time[0][7].obj = document.all ? document.all["Layer3"] : null;
    document.MM_Time[0][7].keyFrames = new Array(2, 5, 9, 13, 16, 18);
    document.MM_Time[0][7].values = new Array(4);
    document.MM_Time[0][7].values[0] = new Array(458,458,458,458,457,457,457,458,463,468,473,478,468,459,453,454,458);
    document.MM_Time[0][7].values[0].prop = "left";
    document.MM_Time[0][7].values[1] = new Array(101,98,94,91,93,96,99,101,95,88,80,71,77,85,91,97,101);
    document.MM_Time[0][7].values[1].prop = "top";
    if (!ns) {
        document.MM_Time[0][7].values[0].prop2 = "style";
        document.MM_Time[0][7].values[1].prop2 = "style";
    }
    document.MM_Time[0][7].values[2] = new Array(31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31);
    document.MM_Time[0][7].values[2].prop = "width";
    if (!ns)
        document.MM_Time[0][7].values[2].prop2 = "style";
    document.MM_Time[0][7].values[3] = new Array(42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42);
    document.MM_Time[0][7].values[3].prop = "height";
    if (!ns)
        document.MM_Time[0][7].values[3].prop2 = "style";
    document.MM_Time[0].lastFrame = 19;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}
//-->
</SCRIPT>

<SCRIPT language=ja;vascript>
<!--
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</SCRIPT>

 


<!-- 第 2 步: -->
<!-- 把<BODY>中的屬性代碼改為: -->

<BODY bgColor=#ccccff onload="MM_timelinePlay('Timeline1')">

 

<!-- 第 3 步: -->
<!-- 把下面的代碼加到<BODY></BODY>區域中: -->

<DIV id=Layer1
style="HEIGHT: 52px; LEFT: 264px; POSITION: absolute; TOP: 86px; WIDTH: 58px; Z-INDEX: 1"><font color="#ff3333" face="隸書" size="7">會</font></DIV>
<DIV id=Layer2
style="HEIGHT: 27px; LEFT: 324px; POSITION: absolute; TOP: 112px; WIDTH: 36px; Z-INDEX: 2"><font color="#336600" size="5" face="隸書">跳</font></DIV>
<DIV id=Layer4
style="HEIGHT: 22px; LEFT: 363px; POSITION: absolute; TOP: 116px; WIDTH: 25px; Z-INDEX: 4"><font color="#ffff00" face="隸書" size="4">舞</font></DIV>
<DIV id=Layer5
style="HEIGHT: 1px; LEFT: 388px; POSITION: absolute; TOP: 116px; WIDTH: 1px; Z-INDEX: 5"><font color="#ff33ff" face="隸書" size="4">的</font></DIV>
<DIV id=Layer6
style="HEIGHT: 12px; LEFT: 408px; POSITION: absolute; TOP: 116px; WIDTH: 18px; Z-INDEX: 6"><font color="#0000cc" face="隸書" size="4">文</font></DIV>
<DIV id=Layer7
style="HEIGHT: 15px; LEFT: 428px; POSITION: absolute; TOP: 116px; WIDTH: 21px; Z-INDEX: 7"><font color="#ff6633" face="隸書" size="4">本</font></DIV>
<DIV id=Layer3
style="HEIGHT: 42px; LEFT: 453px; POSITION: absolute; TOP: 91px; WIDTH: 31px; Z-INDEX: 8"><B><FONT
color=#00ff00 size=+5><I><FONT
color=#009900>!</FONT></I></FONT></B></DIV>
================================================

5、文字水波效果,黑變灰,不是很明顯

<script language="ja;vascript1.2">
var message="廣告文字歡迎訪問風云設計"
var neonbasecolor="gray"
var neontextcolor="000000"
var flashspeed=100
var n=0
if (document.all){
document.write('<font size="2" face="宋體" color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight">'+message.charAt(m)+'</span>')
document.write('</font>')
var tempref=document.all.neonlight
}
else
document.write(message)
function neon(){
if (n==0){
for (m=0;m<message.length;m++)
tempref[m].style.color=neonbasecolor
}
tempref[n].style.color=neontextcolor
if (n<tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}
function beginneon(){
if (document.all)
flashing=setInterval("neon()",flashspeed)
}
beginneon()

</script>
==============

6、0、1數字下落 有點象閃客帝國

<!-- 第 1 步: -->
<!-- 把<BODY>中的屬性代碼改為: -->

<BODY bgcolor=#000000>

 

<!-- 第 2 步: -->
<!-- 把下面的代碼加到<BODY></BODY>區域中: -->

<script language="ja;vascript">
<!--
if (document.all){
Cols=6;
Cl=24;//Space's are included so real length is 48!
Cs=10;
Ts=10;
Tc='#008800';
Tc1='#00ff00';
MnS=20;
MxS=30;
I=Cs;
Sp=new Array();S=new Array();Y=new Array();
C=new Array();M=new Array();B=new Array();
RC=new Array();E=new Array();Tcc=new Array(0,1);
document.write("<div id='Container' style='position:absolute;top:0;left:-"+Cs+"'>");
document.write("<div style='position:relative'>");
for(i=0; i < Cols; i++){
S[i]=I+=Cs;
document.write("<div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"
+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden'></div>");
}
document.write("</div></div>");

for(j=0; j < Cols; j++){
RC[j]=1+Math.round(Math.random()*Cl); 
Y[j]=0;
Sp[j]=Math.round(MnS+Math.random()*MxS);
for(i=0; i < RC[j]; i++){
 B[i]='';
 C[i]=Math.round(Math.random()*1)+' ';
 M[j]=B[0]+=C[i];
 }
}
function Cycle(){
Container.style.top=window.document.body.scrollTop;
for (i=0; i < Cols; i++){
var r = Math.floor(Math.random()*Tcc.length);
E[i] = '<font color='+Tc1+'>'+Tcc[r]+'</font>';
Y[i]+=Sp[i];

if (Y[i] > window.document.body.clientHeight){
 for(i2=0; i2 < Cols; i2++){
 RC[i2]=1+Math.round(Math.random()*Cl); 
 for(i3=0; i3 < RC[i2]; i3++){
 B[i3]='';
 C[i3]=Math.round(Math.random()*1)+' ';
 C[Math.floor(Math.random()*i2)]=' '+' ';
 M[i]=B[0]+=C[i3];
 Y[i]=-Ts*M[i].length/1.5;
 A[i].style.visibility='visible';
 }
 Sp[i]=Math.round(MnS+Math.random()*MxS);
 }
}
A[i].style.top=Y[i];
A[i].innerHTML=M[i]+' '+E[i]+' ';
}
setTimeout('Cycle()',20)
}
Cycle();
}
// -->
</script>
==============

7、鼠標懸移到鏈接文字后出現跑馬燈式樣的說明文字

<SCRIPT LANGUAGE="ja;vascript">
<!-- Begin
window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer >= 4);
 var IE4 = (bName == "Microsoft Internet Explorer"
 && bVer >= 4);
 var NS3 = (bName == "Netscape" && bVer < 4);
 var IE3 = (bName == "Microsoft Internet Explorer"
 && bVer < 4);
 var scroll_length = 150;
 var time_length =50;
 var begin_pos = 200;
 var i;
 var j;
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
 }else{
 layerStyleRef="layer.style.";
 layerRef="document.all";
 styleSwitch=".style";
 }
}
//SCROLL
function Scroll(layerName){
if (NS4 || IE4) {
 if (NS4 || IE4) {
 if(i<(begin_pos+scroll_length)){
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.visibility="visible"');
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.left="'+i+'"');
 i++;
 j++;
 if(i==j){
 setTimeout("Scroll('"+layerName+"')",time_length);}
 }
 }
 }
}
function StopScroll(layerName)
{
i=begin_pos+scroll_length;
  eval(layerRef+'["'+layerName+'"]'+
  styleSwitch+'.left="'+i+'"');
  hideLayer(layerName);
}
function reset()
{
i=begin_pos;
j=i;
}
function hideLayer(layerName){
 if (NS4 || IE4) {
 eval(layerRef+'["'+layerName+'"]'+
 styleSwitch+'.visibility="hidden"');
 }
 }
//  End -->
</script>
<center>
<a href="#" class="link" onmouseover="ja;vascript:reset();Scroll('prem_hint');" onmouseout="ja;vascript:StopScroll('prem_hint');">鼠標移到此鏈接上,看看效果。</a>
</center>
<div id="prem_hint" style="position:relative; visibility:hidden;color:FF9900" class="prem_hint">
在這里放上對鏈接的文字說明,效果是不是很不錯呢!
</div>
====================================================

8、多條問候語句特效替換

<script language="ja;vascript1.2">
var delay=2000
var scrollwidth=210
var scrollheight=75
var message=new Array()
var openingtag='<font face="Arial" size=3 color=FF9900>'
message[0]='<b>i love you </b>'
message[1]='<b>i love you foowin.com</b>'
message[2]='<b>foowin.com i love you too</b>'
var closingtag='</font>'
var hoffset=-10
</script>
<ilayer width=&{scrollwidth}; height=&{scrollheight}; name="sslide">
<layer name="sslide2" width=&{scrollwidth}; height=&{scrollheight};></layer>
</ilayer>
<script language="ja;vascript1.2">
var inc=1
var ns4=document.layers
var ie5ns6=document.getElementById||document.all
if (ie5ns6)
document.write(openingtag+'<div id="flyin" style="position:relative;width:'+scrollwidth+';height:'+scrollheight+';">'+message[0]+'</div>'+closingtag)
function updatemsg(){
crossobj.style.left=-2000
crossobj.style.fontStyle="italic"
crossobj.innerHTML=message[inc]
crossobj.style.left=crossobj.offsetWidth*(-1)+hoffset
start=setInterval("animatein()",50)
inc=(inc<message.length-1)? inc+1 : 0
}
function animatein(){
if (parseInt(crossobj.style.left)<0)
crossobj.style.left=parseInt(crossobj.style.left)+20
else{
crossobj.style.left=0
crossobj.style.fontStyle="normal"
clearInterval(start)
}
}
function updatemsgns4(){
document.sslide.document.sslide2.document.write(openingtag+message[inc]+closingtag)
document.sslide.document.sslide2.document.close()
inc=(inc<message.length-1)? inc+1 : 0
}
function initialize(){
if (ie5ns6){
crossobj=document.getElementById? document.getElementById("flyin") : document.all.flyin
setInterval("updatemsg()",delay+1000)
}
else if (ns4){
document.sslide.document.sslide2.document.write(openingtag+message[0]+closingtag)
document.sslide.document.sslide2.document.close()
setInterval("updatemsgns4()",delay)
}
}
window.onload=initialize
</script>
=======================

9、變化字特效

<!-- 第 1 步: -->
<!-- 把<BODY>中的屬性代碼改為: -->

<BODY onload=blurtext();>

 

<!-- 第 2 步: -->
<!-- 把下面的代碼加到<BODY></BODY>區域中: -->

<SCRIPT language=ja;vascript>
<!--
var thissize=20
var textfont="arial"
var textcolor= new Array()
textcolor[0]="lime"
textcolor[1]="#FF9900"
textcolor[2]="aqua"
textcolor[3]="yellow"
textcolor[4]="#FF8040"
textcolor[5]="#FFD1BB"
textcolor[6]="#CCCCFF"
textcolor[7]="#CCCC33"
textcolor[8]="#ff8040"
textcolor[9]="yellow"
textcolor[10]="lime"
textcolor[11]="#FF9900"

var message = new Array()
message[0]="   FOOWIN.COM"
message[1]="Welcome To You!"
message[2]="   FOOWIN.COM"
message[3]="Welcome To You!"

var i_blurstrength=15
var i_message=0
var i_textcolor=0

function blurtext() {       
    if(document.all) {
        if (i_blurstrength >=-2) {
            if (i_textcolor >=textcolor.length-1) {i_textcolor=textcolor.length-1}
            blurthis.innerHTML="<span id='blurpit1' style='position:absolute;visibility:visible;width:600px; top:100px;left:5px;filter:blur(add=0,strength="+i_blurstrength+",direction=90);font-family:"+textfont+";font-size:"+thissize+"pt;color:"+textcolor[i_textcolor]+"'>"+message[i_message]+"</span>";
        document.close()
        i_blurstrength=i_blurstrength-2
        i_textcolor++
        var timer=setTimeout("blurtext()",50)
        }
       
        else {
            if (i_textcolor >=textcolor.length-1) {i_textcolor=textcolor.length-1}
            blurthis.innerHTML="<span id='blurit1' style='position:absolute;visibility:visible;width:600px; top:100px;left:5px;filter:blendTrans(duration=4.2);font-family:"+textfont+";font-size:"+thissize+"pt;color:FF0000'>"+message[i_message]+"</span>";
            i_message++
            if (i_message>=message.length){i_message=0}
           
            i_blurstrength=20
            i_textcolor=0
            clearTimeout(timer)
            var timer=setTimeout("blurtext()",2000)
        }
    }   
}

//-->
</SCRIPT>
<p id=blurthis></p>
=========================

10、文字3D效果,線腳本實現

<!-- 第 1 步: -->
<!-- 把下面的代碼加到<HEAD></HEAD>區域中: -->

<SCRIPT language=VBScript>
Sub Window_OnLoad()
    call SG1.Scale(0.50, 0.50, 0.50)
    call SG2.Scale(0.50, 0.50, 0.50)
    call SG3.Scale(0.50, 0.50, 0.50)
    call SG4.Scale(0.50, 0.50, 0.50)
    call SG1.Rotate(0, 0, 0)
    call SG2.Rotate(90, 0, 0)
    call SG3.Rotate(0, 90, 0)
    RotateAll
end sub

' sets rotation speed and behavior as well as creating loop

Sub RotateAll
    Call SG1.Rotate(4,6,2)
    Call SG2.Rotate(4,6,2)
    Call SG3.Rotate(4,6,2)
    Call SG4.Rotate(4,6,2)
    FILK = Window.SetTimeOut("Call RotateAll", 10, "VBSCript")
End Sub
</SCRIPT>

 


<!-- 第 2 步: -->
<!-- 把下面的代碼加到<BODY></BODY>區域中: -->

<OBJECT classid=CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6 id=SG4
style="HEIGHT: 400px; LEFT: 25%; POSITION: absolute; TOP: 25%; WIDTH: 400px; ZINDEX: 0"><PARAM
NAME="Line0001" VALUE="SetLineStyle(0)"><PARAM NAME="Line0002" VALUE="SetFillColor(164, 164, 255)"><PARAM
NAME="Line0003" VALUE="SetFillStyle(1)"><PARAM NAME="Line0004" VALUE="SetFont('Arial', 180, 700, 0, 0,
0)"><PARAM NAME="Line0005" VALUE="Text('ja;vascript', -95, 87)"></OBJECT>
<OBJECT classid=CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6 id=SG1
style="HEIGHT: 400px; LEFT: 25%; POSITION: absolute; TOP: 25%; WIDTH: 400px; ZINDEX: 0"><PARAM
NAME="Line0001" VALUE="SetLineStyle(1)"><PARAM NAME="Line0002" VALUE="SetLineColor(0, 0, 0)"><PARAM
NAME="Line0003" VALUE="SetFillStyle(0)"><PARAM NAME="Line0004" VALUE="SetFont('Arial', 180, 700, 0, 0,
0)"><PARAM NAME="Line0005" VALUE="Text('ja;vascript', -95, 87)"></OBJECT>
<OBJECT classid=CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6 id=SG3
style="HEIGHT: 300px; LEFT: 25%; POSITION: absolute; TOP: 25%; WIDTH: 400px; ZINDEX: 1"><PARAM
NAME="Line0001" VALUE="SetLineStyle(1)"><PARAM NAME="Line0002" VALUE="SetLineColor(66,158, 144)"><PARAM
NAME="Line0003" VALUE="SetFillStyle(0)"><PARAM NAME="Line0004" VALUE="SetFont('Arial', 280, 700, 0, 0,
0)"><PARAM NAME="Line0005" VALUE="Text('linlin', -95, 87)"></OBJECT>
<OBJECT classid=CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6 id=SG2
style="HEIGHT: 400px; LEFT: 25%; POSITION: absolute; TOP: 25%; WIDTH: 400px; ZINDEX: 2"><PARAM
NAME="Line0001" VALUE="SetLineStyle(1)"><PARAM NAME="Line0002" VALUE="SetLineColor(255, 111,210)"><PARAM
NAME="Line0003" VALUE="SetFillStyle(0)"><PARAM NAME="Line0004" VALUE="SetFont('Arial', 180, 700, 0, 0,
0)"><PARAM NAME="Line0005" VALUE="Text('ja;vascript', -95, 0)"></OBJECT>

11、很不錯的文字展示噢~流水線

<script>
var message="Http://www.foowin.com/ 網頁特效!網站站長必不可少的利器!"
var n=0;
if (document.all){
document.write('<font size="12px" color="#006666">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight" style="font-size:12px">'+message.charAt(m)+'</span>')
document.write('</font>')
var tempref=document.all.neonlight
}
else
document.write(message)
function neon(){
if (n==0){
for (m=0;m<message.length;m++)
tempref[m].style.color="#006666"
}
tempref[n].style.color="#3fadc7"
if (n<tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",1500)
return
}
}
function beginneon(){
if (document.all)
flashing=setInterval("neon()",23)
}
beginneon()
</script>
==========

标签:文字特效

相關文章:

推薦設計

最新文章