特效

JavaScript

 

炽热文字的特殊效果[适用于IE4++]
(根据下面的说明进行共3步)

====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>之间[适当的位置]:

<span id="glowtext">这里是要显示的文字</span>

====3、[可选项]改变文字颜色和背景色可以得到不同的效果。文字颜色修改,只要修改filter:glow(color=red,strength=2); 中的color项,strength为颜色的深度值 。