闪烁发光的文字

发布时间:2018年2月23日 作者:未知 查看次数:1731


<html>


<head>

<title>文字特效</title>


<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>


</head>

<body bgcolor="#FFFFFF">


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



<br><br><br><br><br><br>


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

(filters是css中的滤镜,这种效果只在IE的浏览器中才支持,其它的不支持filters的浏览器使用CSS3)


</body>

</html>



版权所有!www.sieye.cn
E.Mail:sieye@sohu.com QQ:66697110