打字代码
<div align="center" id="myexample" style="border:5px ridge red; width:650"><h2><span id="fly" style="color:#ff0000"></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>
[ 本帖最后由 祝福 于 2008-8-15 09:00 编辑 ] <TEXTAREA name=a rows=6 cols=50><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></TEXTAREA><BR><BR>
<DIV style=\"FILTER: Dropshadow(offX=1,offY=1,color=#0000ff); WIDTH: 210px; HEIGHT: 45px\" align=center><OBJECT id=player style=\"FILTER: invert Alpha(opacity=55)\" height=45 width=210 classid=clsid:6bf52a52-394a-11d3-b153-00c04f79faa6><PARAM NAME=\"URL\" VALUE=\"http://music.pc120.net.cn/MusicFiles/1/1424/4591/ithlj_181175.wma\"><PARAM NAME=\"rate\" VALUE=\"1\"><PARAM NAME=\"balance\" VALUE=\"0\"><PARAM NAME=\"currentPosition\" VALUE=\"62.9642449\"><PARAM NAME=\"defaultFrame\" VALUE=\"\"><PARAM NAME=\"playCount\" VALUE=\"1\"><PARAM NAME=\"autoStart\" VALUE=\"-1\"><PARAM NAME=\"currentMarker\" VALUE=\"0\"><PARAM NAME=\"invokeURLs\" VALUE=\"-1\"><PARAM NAME=\"baseURL\" VALUE=\"\"><PARAM NAME=\"volume\" VALUE=\"50\"><PARAM NAME=\"mute\" VALUE=\"0\"><PARAM NAME=\"uiMode\" VALUE=\"full\"><PARAM NAME=\"stretchToFit\" VALUE=\"-1\"><PARAM NAME=\"windowlessVideo\" VALUE=\"0\"><PARAM NAME=\"enabled\" VALUE=\"-1\"><PARAM NAME=\"enableContextMenu\" VALUE=\"0\"><PARAM NAME=\"fullScreen\" VALUE=\"0\"><PARAM NAME=\"SAMIStyle\" VALUE=\"\"><PARAM NAME=\"SAMILang\" VALUE=\"\"><PARAM NAME=\"SAMIFilename\" VALUE=\"\"><PARAM NAME=\"captioningID\" VALUE=\"\"><PARAM NAME=\"enableErrorDialogs\" VALUE=\"0\"><PARAM NAME=\"_cx\" VALUE=\"5556\"><PARAM NAME=\"_cy\" VALUE=\"1191\"></OBJECT></DIV>
[ 本帖最后由 祝福 于 2008-2-5 23:04 编辑 ] 试试看
[ 本帖最后由 小二 于 2008-2-5 22:55 编辑 ] 可以了,试用成功! 不错,如果再能调节打字的速度,就可以拿来作歌词同步了(可以吗?)~~呵呵^_^ 闪鸟老师,那不就是vml代码了吗? <BR><BR>
应该能调节速度,但绝对同步不了. 大家新年快乐
<BR><BR>
http://up1.googletounion.com/data/bbs/10/96/1096/a/08/05/20080203_d3732093825571afe3f8HmTeBJb7LIvy.gif
[ 本帖最后由 gaoss33 于 2008-2-6 14:49 编辑 ] 学习了.谢谢您的分享..... 我来试试
[ 本帖最后由 祝福 于 2008-3-17 19:34 编辑 ] <P><IMG alt=\"\" src=\"http://www.yinhuabbs.cn/images/smilies/default/handshake1.gif\" border=0 smilieid=\"128\"> 可以的你复制代码到新手试贴区试!</P>
<P> </P>
<P>js代码在同页面一样的代码有冲突的.</P>
[ 本帖最后由 祝福 于 2008-3-17 19:37 编辑 ]