熾熱文字效果

字號:


    1、將以下代碼加入heml的<head></head>之間:
    <style>
    <!--
    #glowtext{
    filter:glow(color=red,strength=2);
    width:100%;
    }
    -->
    </style>
    <script language=javascript1.2>
    function glowit(which){
    if (document.all.glowtext[which].filters[0].strength==2)
    document.all.glowtext[which].filters[0].strength=1
    else
    document.all.glowtext[which].filters[0].strength=2
    }
    function glowit2(which){
    if (document.all.glowtext.filters[0].strength==2)
    document.all.glowtext.filters[0].strength=1
    else
    document.all.glowtext.filters[0].strength=2
    }
    function startglowing(){
    if (document.all.glowtext&&glowtext.length){
    for (i=0;i<glowtext.length;i++)
    eval('setinterval(glowit('+i+'),150)')
    }
    else if (glowtext)
    setinterval(glowit2(0),150)
    }
    if (document.all)
    window.onload=startglowing
    </script>
    2、將以下代碼加入到heml的<body></body>之間[適當(dāng)?shù)奈恢胅:
    <span id=glowtext>這里是要顯示的文字</span>
    3、[可選項]改變文字顏色和背景色可以得到不同的效果。文字顏色修改,只要修改filter:glow(color=red,strength=2); 中的color項,strength為顏色的深度值 。