文字连续出现(1)
<script language=javascript>var style=document.all;
function writeOnText(obj,str){
if(style)eval(obj+'.innerHTML=str'); }
var dispStr=new Array("欢迎光临javascript特效站!!!");
var overMe=0;
function txtTyper(str,idx,idObj,spObj,clr1,clr2,delay,plysnd)
{
var tmp0=tmp1= '',skip=100;
if (idx<=str.length) //both &&
{
tmp0 = str.slice(0,idx);
tmp1 = str.charAt(idx++);
overMe=0;
writeOnText(idObj, "<span class="+spObj+"><font color='"+clr1+"'>"+tmp0+"</font><font color='"+clr2+"'>"+tmp1+"</font></span>");
setTimeout("txtTyper('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+" ,"+plysnd+")",delay);
}
}
function init()
{txtTyper(dispStr[0], 0, 'ttl0', 'ttl1', 'red', '#99FF33', 300, 0);}
</script>
<DIV class=ttl1 id=ttl0></DIV>
<body bgcolor="#fef4d9" onload=init()></body>
[ 本帖最后由 js_friend 于 2011-6-21 23:15 编辑 ]