zoukankan      html  css  js  c++  java
  • 文字变色逐个出现的特效源码

    脚本说明:
    第一步:把如下代码加入<body><center><script language=javascript src="../js/shang.js"></script>
    区域中
    <script language=javascript>
    var layers =document.layers,style=document.all,both=layers||style,idme=908601;
    if(layers){layerRef='document.layers';styleRef ='';}if(style){layerRef='document.all';styleRef = 
    '.style';}
    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("欢迎光临javascript特效站!!!");
    var overMe=0;
    function txtTyper(str,idx,idObj,spObj,clr1,clr2,delay,plysnd){
    var tmp0=tmp1= '',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++);
    if (overMe==0 && plysnd==1){
    if (navigator.plugins[0]){
    if(navigator.plugins["LiveAudio"][0].type=="audio/basic" && navigator.javaEnabled()){document.embeds
    [0].stop();
    setTimeout("document.embeds[0].play(false)",100);}
    } else if (document.all){
    ding.Stop();
    setTimeout("ding.Run()",100);}
    overMe=1;}else 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><center><script language=javascript src="../js/shang.js"></script>
    区域中
    <body bgcolor="#fef4d9" onload=init()>

  • 相关阅读:
    JavaScript的DOM操作(节点操作)
    php算法
    php常用函数
    去掉表单中的回车、换行、空格
    linux(centos)搭建SVN服务器
    同一台机子上用多个git 账号
    房屋交易合同
    简单的css 菜单
    Spring Collections XML 配置
    不同java 版本的新功能
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3144900.html
Copyright © 2011-2022 走看看