Tip: you can modify some code before running
<script language=javascript>Var style = document. all, both = style, idme = 908601;<!--定义变量-->If (style) {layerRef = 'document. All'; styleRef = '. Style ';}<!--对变量进行赋值-->Function writeOnText (obj, str) {eval (obj + '. innerHTML = str ');<!--向窗口中写入字符串-->} Var dispStr = new Array ("Welcome to the javascript world! "); Var overMe = 0; function txtTyper (str, idx, idObj, spObj, clr1, clr2, delay, plysnd) {if (both & idx <= str. length) {if (str. charAt (idx) = '<') {while (str. charAt (idx )! = '>') Idx ++;} if (str. charAt (idx) = '& str. charAt (idx + 1 )! = '') {While (str. charAt (idx )! = ';') Idx ++;} tmp0 = str. slice (0, idx );<!--获得字符串的一部分-->Tmp1 = str. charAt (idx ++); if (overMe = 0 & plysnd = 1) overMe = 1;<!--标志位改变-->Else overMe = 0;<!--标志位改变-->WriteOnText (idObj ,"<font color='"+clr1+"'>"+ Tmp0 +"</font><font color='"+clr2+"'>"+ Tmp1 +"</font>");<!--获得待显示的字符串-->SetTimeout ("txtTyper ('" + str + "'," + idx + ", '" + idObj + "', '" + spObj + "', '"+ clr1 +"', '"+ clr2 +"', "+ delay +", "+ plysnd +") ", delay );<!--设置逐个显示的频率-->} Function init () {txtTyper (dispStr [0], 0, 'ttl0', 'ttl1', '#339933', '# 99ff33', 300, 0 );<!--设置参数,调用函数txtTyper-->}</script><body onload=init() ><DIV class=ttl1 id=ttl0></dIV></body></html><!--本例程实现了呈变色并逐个显示的文字--><!--同时本例程还支持对喇叭的调用--><!--定时器的使用--><!--逐个显示效果的实现过程-->
Tip: you can modify some code before running