分享

变化字特效变化字特效

 风声之家 2017-01-26
要完成此效果需要两个步骤

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

<SCRIPT language=javaScript>
<!--
var thissize=20
var textfont="arial"
var textcolor= new Array()
textcolor[0]="lime"
textcolor[1]="#FF9900"
textcolor[2]="aqua"
textcolor[3]="yellow"
textcolor[4]="#FF8040"
textcolor[5]="#FFD1BB"
textcolor[6]="#CCCCFF"
textcolor[7]="#CCCC33"
textcolor[8]="#ff8040"
textcolor[9]="yellow"
textcolor[10]="lime"
textcolor[11]="#FF9900"

var message = new Array()
message[0]="   JavaScript Fairyland"
message[1]="Welcome To You!"
message[2]="   JavaScript Fairyland"
message[3]="Welcome To You!"

var i_blurstrength=15
var i_message=0
var i_textcolor=0

function blurtext() {        
    if(document.all) {
        if (i_blurstrength >=-2) {
            if (i_textcolor >=textcolor.length-1) {i_textcolor=textcolor.length-1}
            blurthis.innerHTML="<span id='blurpit1' style='position:absolute;visibility:visible;width:600px; top:100px;left:5px;filter:blur(add=0,strength="+i_blurstrength+",direction=90);font-family:"+textfont+";font-size:"+thissize+"pt;color:"+textcolor[i_textcolor]+"'>"+message[i_message]+"</span>";
        document.close()
        i_blurstrength=i_blurstrength-2
        i_textcolor++
        var timer=setTimeout("blurtext()",50)
        }
        
        else {
            if (i_textcolor >=textcolor.length-1) {i_textcolor=textcolor.length-1}
            blurthis.innerHTML="<span id='blurit1' style='position:absolute;visibility:visible;width:600px; top:100px;left:5px;filter:blendTrans(duration=4.2);font-family:"+textfont+";font-size:"+thissize+"pt;color:FF0000'>"+message[i_message]+"</span>";
            i_message++
            if (i_message>=message.length){i_message=0}
            
            i_blurstrength=20
            i_textcolor=0
            clearTimeout(timer)
            var timer=setTimeout("blurtext()",2000)
        }
    }    
}

//-->
</SCRIPT>

第二步:把“onload=blurtext();”<body>标记里
例如:<body onload=blurtext();>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约