<div class="htmlarea"> <textarea id="runcode12746"> <title>文字瞬间从左到右显示的JS</title> <script language="JavaScript"> var newslist=new Array(); var cnt=0; var curr = ""; var i=-1; newslist[0]=new Array("欢迎光临脚本之家者","") newslist[1]=new Array("我们更讲究代码质量","") newslist[2]=new Array("欢迎下次再来","") function newsticker() { if (i < newslist[cnt][0].length - 1) { i++; temp1 = newslist[cnt][0]; temp1 = temp1.split(''); curr = curr+temp1[i]; temp2 = newslist[cnt][1]; mtxt.innerHTML = "<small><a href='/'><font color='#ff0000'>"+curr+"_"; setTimeout('newsticker()',10) return; } i = -1; curr = ""; if (cnt<newslist.length-1) cnt++; else cnt=0; setTimeout('newsticker()',3000) } </script> <span id="mtxt" style="position:relative;top:1px;padding:5px 5px 5px 5px;font-family:Arial;font-size:10pt;width:100%;overflow:auto;height:50px"> </span> </textarea><br><input onclick="runEx('runcode12746')" type="button" value="运行代码"> <input onclick="doCopy('runcode12746')" type="button" value="复制代码"> <input onclick="doSave(runcode12746)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>