Cheer 发表于 2007-4-28 11:03:02

文本特效会跳舞的文本

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
<script language=javascript>
<!--
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;
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;
      if (sprite.charat(0) == 's') {
      if (sprite.obj) {
          numkeyfr = sprite.keyframes.length; firstkeyfr = sprite.keyframes;
          if (fnew >= firstkeyfr && fnew <= sprite.keyframes) {
            keyfrm=1;
            for (j=0; j<sprite.values.length; j++) {
            props = sprite.values;
            if (numkeyfr != props.length) {
                if (props.prop2 == null) sprite.obj = props;
                else      sprite.obj = props;
            } else {
                while (keyfrm<numkeyfr && fnew>=sprite.keyframes) keyfrm++;
                if (firsttime || fnew==sprite.keyframes) {
                  if (props.prop2 == null) sprite.obj = props;
                  else      sprite.obj = props;
      } } } } }
      } 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;
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 : tmln[(tmln.length-1)-i];
    if (sprite.charat(0) == "s") {
      numkeyfr = sprite.keyframes.length;
      firstkeyfr = sprite.keyframes;
      lastkeyfr = sprite.keyframes;
      if ((jmpfwd && fnew<firstkeyfr) || (!jmpfwd && lastkeyfr<fnew)) continue;
      for (keyfrm=1; keyfrm<numkeyfr && fnew>=sprite.keyframes; keyfrm++);
      for (j=0; j<sprite.values.length; j++) {
      props = sprite.values;
      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;
          else      sprite.obj = props;
      } }
    } 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 = new array(8);
    document.mm_time["timeline1"] = document.mm_time;
    document.mm_time.mm_name = "timeline1";
    document.mm_time.fps = 10;
    document.mm_time = new string("sprite");
    document.mm_time.slot = 1;
    if (ns)
      document.mm_time.obj = document["layer1"];
    else
      document.mm_time.obj = document.all ? document.all["layer1"] : null;
    document.mm_time.keyframes = new array(2, 6, 9, 12, 15, 18);
    document.mm_time.values = new array(4);
    document.mm_time.values = new array(263,264,265,266,268,268,268,268,271,272,273,270,268,266,265,264,263);
    document.mm_time.values.prop = "left";
    document.mm_time.values = new array(101,95,89,82,76,87,98,108,100,93,86,91,96,100,102,104,106);
    document.mm_time.values.prop = "top";
    if (!ns) {
      document.mm_time.values.prop2 = "style";
      document.mm_time.values.prop2 = "style";
    }
    document.mm_time.values = new array(58,54,50,46,43,33,24,15,20,25,31,36,41,47,48,49,50);
    document.mm_time.values.prop = "width";
    if (!ns)
      document.mm_time.values.prop2 = "style";
    document.mm_time.values = new array(52,51,50,49,48,46,44,42,43,44,45,46,47,49,48,47,47);
    document.mm_time.values.prop = "height";
    if (!ns)
      document.mm_time.values.prop2 = "style";
    document.mm_time = new string("sprite");
    document.mm_time.slot = 2;
    if (ns)
      document.mm_time.obj = document["layer2"];
    else
      document.mm_time.obj = document.all ? document.all["layer2"] : null;
    document.mm_time.keyframes = new array(2, 5, 9, 12, 15, 18);
    document.mm_time.values = new array(2);
    document.mm_time.values = new array(323,323,322,322,322,322,322,323,324,326,328,326,324,322,322,322,323);
    document.mm_time.values.prop = "left";
    document.mm_time.values = new array(126,120,115,111,110,111,111,111,108,105,101,105,109,113,117,122,126);
    document.mm_time.values.prop = "top";
    if (!ns) {
      document.mm_time.values.prop2 = "style";
      document.mm_time.values.prop2 = "style";
    }
    document.mm_time = new string("sprite");
    document.mm_time.slot = 3;
    if (ns)
      document.mm_time.obj = document["layer4"];
    else
      document.mm_time.obj = document.all ? document.all["layer4"] : null;
    document.mm_time.keyframes = new array(2, 5, 9, 12, 15, 18);
    document.mm_time.values = new array(3);
    document.mm_time.values = new array(363,363,363,363,363,363,363,363,365,366,368,366,364,363,363,363,363);
    document.mm_time.values.prop = "left";
    document.mm_time.values = new array(131,123,115,107,113,119,125,131,122,111,101,113,124,131,131,131,131);
    document.mm_time.values.prop = "top";
    if (!ns) {
      document.mm_time.values.prop2 = "style";
      document.mm_time.values.prop2 = "style";
    }
    document.mm_time.values = new array(22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22);
    document.mm_time.values.prop = "width";
    if (!ns)
      document.mm_time.values.prop2 = "style";
    document.mm_time = new string("sprite");
    document.mm_time.slot = 4;
    if (ns)
      document.mm_time.obj = document["layer5"];
    else
      document.mm_time.obj = document.all ? document.all["layer5"] : null;
    document.mm_time.keyframes = new array(2, 5, 9, 12, 15, 18);
    document.mm_time.values = new array(2);
    document.mm_time.values = new array(388,390,391,393,392,391,390,388,390,394,398,397,395,393,390,389,388);
    document.mm_time.values.prop = "left";
    document.mm_time.values = new array(131,128,124,121,124,126,129,131,119,103,86,105,122,136,137,134,131);
    document.mm_time.values.prop = "top";
    if (!ns) {
      document.mm_time.values.prop2 = "style";
      document.mm_time.values.prop2 = "style";
    }
    document.mm_time = new string("sprite");
    document.mm_time.slot = 5;
    if (ns)
      document.mm_time.obj = document["layer6"];
    else
      document.mm_time.obj = document.all ? document.all["layer6"] : null;
    document.mm_time.keyframes = new array(2, 5, 9, 12, 15, 18);
    document.mm_time.values = new array(2);
    document.mm_time.values = new array(413,413,413,413,413,413,413,413,415,416,418,416,414,413,413,413,413);
    document.mm_time.values.prop = "left";
    document.mm_time.values = new array(131,124,118,111,116,120,125,131,119,105,91,107,121,131,131,131,131);
    document.mm_time.values.prop = "top";
    if (!ns) {
      document.mm_time.values.prop2 = "style";
      document.mm_time.values.prop2 = "style";
    }
    document.mm_time = new string("sprite");
    document.mm_time.slot = 6;
    if (ns)
      document.mm_time.obj = document["layer7"];
    else
      document.mm_time.obj = document.all ? document.all["layer7"] : null;
    document.mm_time.keyframes = new array(2, 5, 9, 12, 15, 18);
    document.mm_time.values = new array(2);
    document.mm_time.values = new array(433,433,433,433,434,436,437,438,435,432,428,427,427,428,430,431,433);
    document.mm_time.values.prop = "left";
    document.mm_time.values = new array(131,131,131,131,128,125,120,116,118,120,121,117,112,106,114,122,131);
    document.mm_time.values.prop = "top";
    if (!ns) {
      document.mm_time.values.prop2 = "style";
      document.mm_time.values.prop2 = "style";
    }
    document.mm_time = new string("behavior");
    document.mm_time.frame = 19;
    document.mm_time.value = "mm_timelinegoto('timeline1','1')";
    document.mm_time = new string("sprite");
    document.mm_time.slot = 7;
    if (ns)
      document.mm_time.obj = document["layer3"];
    else
      document.mm_time.obj = document.all ? document.all["layer3"] : null;
    document.mm_time.keyframes = new array(2, 5, 9, 13, 16, 18);
    document.mm_time.values = new array(4);
    document.mm_time.values = new array(458,458,458,458,457,457,457,458,463,468,473,478,468,459,453,454,458);
    document.mm_time.values.prop = "left";
    document.mm_time.values = new array(101,98,94,91,93,96,99,101,95,88,80,71,77,85,91,97,101);
    document.mm_time.values.prop = "top";
    if (!ns) {
      document.mm_time.values.prop2 = "style";
      document.mm_time.values.prop2 = "style";
    }
    document.mm_time.values = new array(31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31);
    document.mm_time.values.prop = "width";
    if (!ns)
      document.mm_time.values.prop2 = "style";
    document.mm_time.values = new array(42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42);
    document.mm_time.values.prop = "height";
    if (!ns)
      document.mm_time.values.prop2 = "style";
    document.mm_time.lastframe = 19;
    for (i=0; i<document.mm_time.length; i++) {
      document.mm_time.id = null;
      document.mm_time.curframe = 0;
      document.mm_time.delay = 1000/document.mm_time.fps;
    }
}
//-->
</script>

<script language=javascript>
<!--
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>

<meta content="microsoft frontpage 4.0" name=generator></head>
<body bgcolor=#ccccff onload="mm_timelineplay('timeline1')">
<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></body>
页: [1]
查看完整版本: 文本特效会跳舞的文本