文字连续出现(3)
<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)
{
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);
}
else
{
idx=0;
init();
}
}
function init()
{txtTyper(dispStr[0], 0, 'ttl0', 'ttl1', 'red', '#99FF33', 300, 0);}
</script>
<DIV class=ttl1 id=ttl0></DIV>
<body bgcolor="#fef4d9" onload=init()>