156、字符渐变出现

156、字符渐变出现

脚本说明:

第一步:把如下代码加入<body>区域中:

 <div class="ttl1" id="ttl0">

        <script language="javascript1.2">

var layers = document.layers;

var style = document.all;

var both = layers || style;

var huliguo_b = 0;

var huliguo_c = 4;

function writeOnText(obj, str) {

    if (layers) with (document[obj]){

        document.open();

        document.write(str);

        document.close();

    }

    if (style) eval(obj+'.innerHTML= str');

}

var dispStr = new Array("欢迎光临网络编程精彩网页特效栏目      ",

"本站点的地址是:http://www.7stk.com",

"请多提意见,谢谢。webmaster@j0.com",

"");

function txtTyper(str, idx, idObj, spObj, clr1, clr2, delay){

    var tmp0 = tmp1 = ''

    var skip =100;

    if (both && idx <= str.length){

        if (str.charAt(idx) == '<'){while (str.charAt(idx) != '>') idx++; idx++;}

        if (str.charAt(idx) == '&' && str.charAt(idx+1) != ' ') {while (str.charAt(idx) != ';') idx++; idx++;}

        tmp0 = str.slice(0,idx);

        tmp1 = str.charAt(idx++);

         writeOnText(idObj, "<span class="+spObj+"><font color='"+clr1+"'><b>"+tmp0+"</b></font><font color='"+clr2+"'>"+tmp1+"</font></span>");

        setTimeout("txtTyper('"+str+"', "+idx+", '"+idObj+"', '"+spObj+"', '"+clr1+"', '"+clr2+"', "+delay+")",delay);

    }

    else{

        huliguo_b++;

        init();

    }

}

 

function init(){

        if (huliguo_b == huliguo_c) huliguo_b = 0;

        txtTyper(dispStr[huliguo_b], 0, 'ttl0', 'ttl1', '#6666ff', '#9999ff', 100);

}

</script>

      </div>

 

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onLoad=init()>

 

Write a comment

Comments: 0