莺燕音画 发表于 2009-9-13 02:53

<P>这就是代码。把里面的文字改成自己的就行了。</P>
<P> </P>
<P> </P>
<P>&lt;div align=\"center\" id=\"myexample\" style=\"border:5px ridge red; width:650\"&gt;</P>
<P>&lt;h2&gt;&lt;span id=\"fly\" style=\"color:7b007b\"&gt;&lt;/span&gt;&lt;/h2&gt;<BR>&lt;script&gt;<BR>window.onerror=new Function(\"return true\")</P>
<P>message =\'☆总有一个人,会让你心动总有一段往事,会让你感动,总有一个音符,能够触动你的神经,穿透你的内心,慰藉你的灵魂.当眼里漾起忘不掉的从前,我们流泪了…… 在心如锈铁的时代,还有没有一首歌,曾让你感动过? 记忆和我们成长,让我们一起看着它不朽……☆\';</P>
<P>distance = 50;<BR>speed = 500;<BR>if (!document.all)<BR>document.write(\'&lt;h2&gt;\'+message+\'&lt;/h2&gt;\')</P>
<P>&lt;/script&gt;</P>
<P>&lt;script language=\"JavaScript1.2\"&gt;</P>
<P>txt=\"\";num=0;num4=0;flyofle=\"\";flyofwi=\"\";flyofto=\"\"<BR>function stfly(){for(i=0;i != message.length;i++){if(message.charAt(i) != \"$\"){txt=txt+\"&lt;span style=\'position:relative;visibility:hidden;\' id=\'n\"+i+\"\'&gt;\"+message.charAt(i)+\"&lt;\\/span&gt;\"};else{txt=txt+\"&lt;br&gt;\"}};fly.innerHTML=txt;txt=\"\";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidth;flyofto=fly.offsetTop;fly2b()}<BR>function fly2b(){if(num4 != message.length){if(message.charAt(num4) != \"$\"){eval(\"n\"+num4+\".style.left=flyofle-n\"+num4+\".offsetLeft+flyofwi/2\");eval(\"n\"+num4+\".style.top=flyofto-n\"+num4+\".offsetTop+distance\");eval(\"fly3(\'n\"+num4+\"\',eval(n\"+num4+\".style.left.substring(0,n\"+num4+\".style.left.length-2)),(eval(n\"+num4+\".style.left.substring(0,n\"+num4+\".style.left.length-2))/5),eval(n\"+num4+\".style.top.substring(0,n\"+num4+\".style.top.length-2)),(eval(n\"+num4+\".style.top.substring(0,n\"+num4+\".style.top.length-2))/5))\")};num4++;setTimeout(\"fly2b()\",speed)}}<BR>function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2) != 0 &amp;&amp; Math.floor(top2) != -1) || (Math.floor(lef2) != 0 &amp;&amp; Math.floor(lef2) != -1)){if(eval(\"\'\"+lef2+\"\'\").charAt(0) != \'-\'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2) != -1){eval(target+\".style.visibility=\'visible\';\"+target+\".style.left=Math.floor(lef2)\")};else{eval(target+\".style.visibility=\'visible\';\"+target+\".style.left=Math.floor(lef2+1)\")};if(eval(\"\'\"+lef2+\"\'\").charAt(0) != \'-\'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2) != -1){eval(target+\".style.top=Math.floor(top2)\")};else{eval(target+\".style.top=Math.floor(top2+1)\")};setTimeout(\"fly3(\'\"+target+\"\',\"+lef2+\",\"+num2+\",\"+top2+\",\"+num3+\")\",50)}};<BR>stfly()<BR>&lt;/script&gt;&lt;/div&gt;&lt;script language=\"JavaScript1.2\"&gt;<BR>function flashit(){<BR>if (!document.all)<BR>return<BR>if (myexample.style.borderColor==\"fuchsia\")<BR>myexample.style.borderColor=\"yellow\"<BR>else<BR>myexample.style.borderColor=\"fuchsia\"<BR>}<BR>setInterval(\"flashit()\", 1000)<BR>&lt;/script&gt;</P>

寂寞 发表于 2009-10-15 16:14

回复 21# 的帖子

THANKSVERYMUCH~~

蒋胜兵 发表于 2009-11-8 13:33

<div align=\"center\" id=\"myexample\" style=\"border:5px ridge red; width:650\">

<h2><span id=\"fly\" style=\"color:7b007b\"></span></h2>
<script>
window.onerror=new Function(\"return true\")

message =\'☆总有一个人,会让你心动总有一段往事,会让你感动,总有一个音符,能够触动你的神经,穿透你的内心,慰藉你的灵魂.当眼里漾起忘不掉的从前,我们流泪了…… 在心如锈铁的时代,还有没有一首歌,曾让你感动过? 记忆和我们成长,让我们一起看着它不朽……☆\';

distance = 50;
speed = 500;
if (!document.all)
document.write(\'<h2>\'+message+\'</h2>\')

</script>

<script language=\"JavaScript1.2\">

txt=\"\";num=0;num4=0;flyofle=\"\";flyofwi=\"\";flyofto=\"\"
function stfly(){for(i=0;i != message.length;i++){if(message.charAt(i) != \"$\"){txt=txt+\"<span style=\'position:relative;visibility:hidden;\' id=\'n\"+i+\"\'>\"+message.charAt(i)+\"<\\/span>\"};else{txt=txt+\"<br>\"}};fly.innerHTML=txt;txt=\"\";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidth;flyofto=fly.offsetTop;fly2b()}
function fly2b(){if(num4 != message.length){if(message.charAt(num4) != \"$\"){eval(\"n\"+num4+\".style.left=flyofle-n\"+num4+\".offsetLeft+flyofwi/2\");eval(\"n\"+num4+\".style.top=flyofto-n\"+num4+\".offsetTop+distance\");eval(\"fly3(\'n\"+num4+\"\',eval(n\"+num4+\".style.left.substring(0,n\"+num4+\".style.left.length-2)),(eval(n\"+num4+\".style.left.substring(0,n\"+num4+\".style.left.length-2))/5),eval(n\"+num4+\".style.top.substring(0,n\"+num4+\".style.top.length-2)),(eval(n\"+num4+\".style.top.substring(0,n\"+num4+\".style.top.length-2))/5))\")};num4++;setTimeout(\"fly2b()\",speed)}}
function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2) != 0 && Math.floor(top2) != -1) || (Math.floor(lef2) != 0 && Math.floor(lef2) != -1)){if(eval(\"\'\"+lef2+\"\'\").charAt(0) != \'-\'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2) != -1){eval(target+\".style.visibility=\'visible\';\"+target+\".style.left=Math.floor(lef2)\")};else{eval(target+\".style.visibility=\'visible\';\"+target+\".style.left=Math.floor(lef2+1)\")};if(eval(\"\'\"+lef2+\"\'\").charAt(0) != \'-\'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2) != -1){eval(target+\".style.top=Math.floor(top2)\")};else{eval(target+\".style.top=Math.floor(top2+1)\")};setTimeout(\"fly3(\'\"+target+\"\',\"+lef2+\",\"+num2+\",\"+top2+\",\"+num3+\")\",50)}};
stfly()
</script></div><script language=\"JavaScript1.2\">
function flashit(){
if (!document.all)
return
if (myexample.style.borderColor==\"fuchsia\")
myexample.style.borderColor=\"yellow\"
else
myexample.style.borderColor=\"fuchsia\"
}
setInterval(\"flashit()\", 1000)
</script>

蒋胜兵 发表于 2009-11-8 13:35

为什么在有些地方,不能正常显示?

王宏斌 发表于 2010-2-20 16:25

共享一下代码呀?

58317813AAA 发表于 2010-3-3 21:16

<div align=\"center\" id=\"myexample\" style=\"border:5px ridge red; width:650\">

<h2><span id=\"fly\" style=\"color:7b007b\"></span></h2>
<script>
window.onerror=new Function(\"return true\")

message =\'☆总有一个人,会让你心动总有一段往事,会让你感动,总有一个音符,能够触动你的神经,穿透你的内心,慰藉你的灵魂.当眼里漾起忘不掉的从前,我们流泪了…… 在心如锈铁的时代,还有没有一首歌,曾让你感动过? 记忆和我们成长,让我们一起看着它不朽……☆\';

distance = 50;
speed = 500;
if (!document.all)
document.write(\'<h2>\'+message+\'</h2>\')

</script>

<script language=\"JavaScript1.2\">

txt=\"\";num=0;num4=0;flyofle=\"\";flyofwi=\"\";flyofto=\"\"
function stfly(){for(i=0;i != message.length;i++){if(message.charAt(i) != \"$\"){txt=txt+\"<span style=\'position:relative;visibility:hidden;\' id=\'n\"+i+\"\'>\"+message.charAt(i)+\"<\\/span>\"};else{txt=txt+\"<br>\"}};fly.innerHTML=txt;txt=\"\";flyofle=fly.offsetLeft;flyofwi=fly.offsetWidth;flyofto=fly.offsetTop;fly2b()}
function fly2b(){if(num4 != message.length){if(message.charAt(num4) != \"$\"){eval(\"n\"+num4+\".style.left=flyofle-n\"+num4+\".offsetLeft+flyofwi/2\");eval(\"n\"+num4+\".style.top=flyofto-n\"+num4+\".offsetTop+distance\");eval(\"fly3(\'n\"+num4+\"\',eval(n\"+num4+\".style.left.substring(0,n\"+num4+\".style.left.length-2)),(eval(n\"+num4+\".style.left.substring(0,n\"+num4+\".style.left.length-2))/5),eval(n\"+num4+\".style.top.substring(0,n\"+num4+\".style.top.length-2)),(eval(n\"+num4+\".style.top.substring(0,n\"+num4+\".style.top.length-2))/5))\")};num4++;setTimeout(\"fly2b()\",speed)}}
function fly3(target,lef2,num2,top2,num3){if((Math.floor(top2) != 0 && Math.floor(top2) != -1) || (Math.floor(lef2) != 0 && Math.floor(lef2) != -1)){if(eval(\"\'\"+lef2+\"\'\").charAt(0) != \'-\'){lef2=lef2-num2};else{lef2=lef2+(-num2)};if(Math.floor(lef2) != -1){eval(target+\".style.visibility=\'visible\';\"+target+\".style.left=Math.floor(lef2)\")};else{eval(target+\".style.visibility=\'visible\';\"+target+\".style.left=Math.floor(lef2+1)\")};if(eval(\"\'\"+lef2+\"\'\").charAt(0) != \'-\'){top2=top2-num3};else{top2=top2+(-num3)};if(Math.floor(top2) != -1){eval(target+\".style.top=Math.floor(top2)\")};else{eval(target+\".style.top=Math.floor(top2+1)\")};setTimeout(\"fly3(\'\"+target+\"\',\"+lef2+\",\"+num2+\",\"+top2+\",\"+num3+\")\",50)}};
stfly()
</script></div><script language=\"JavaScript1.2\">
function flashit(){
if (!document.all)
return
if (myexample.style.borderColor==\"fuchsia\")
myexample.style.borderColor=\"yellow\"
else
myexample.style.borderColor=\"fuchsia\"
}
setInterval(\"flashit()\", 1000)
</script>

58317813AAA 发表于 2010-3-3 21:17

不行!怎么回事?

y0000 发表于 2010-3-3 21:24

代码放出来就好了
页: 1 2 [3]
查看完整版本: 打字效果