javascript 控制 CSS 滤镜 (2)
<head><style>
<!--
#glowtext
{
filter:glow(color=red,strength=2);
width:100%;
}
#alphalv
{
filter:alpha(opacity=80,finishopacity=0,style=1,startx=10,starty=0,finishx=80,finishy=0);
width:100%;
color:red;
}
#blurmh
{
filter:progid:DXImageTransform.Microsoft.Blur(makeshadow=true,pixelradius=4);
width:15%
}
-->
</style>
<script language="JavaScript1.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 alphait2(m)
{
if (document.all.alphalv.filters[0].opacity==80)
{
document.all["alphalv"].filters[0].opacity=50
alphalv.style.color="red" //参考http://blog.
}
else
{
document.all.alphalv.filters[0].opacity=80
alphalv.style.color="green"
}
}
function blurit(h)
{
if (document.all.blurmh.filters[0].pixelradius==4)
document.all.blurmh.filters[0].pixelradius=h
else
document.all.blurmh.filters[0].pixelradius=4
}
function startglowing()
{
if (glowtext)
setInterval("glowit2(0)",150)
}
function startblurring()
{
if (blurmh)
setInterval("blurit(0)",1000)
}
function startalpha(m)
{
startglowing();
startblurring();
if (alphalv)
setInterval("alphait2(0)",500)
}
window.onload=startalpha;
</script>
<body>
<span id="glowtext">Glow光晕滤镜通道</span>
<span id="alphalv">Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道
Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道
Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道
Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道Alpha灰度滤镜通道</span>
<span id="blurmh">Blur模糊滤镜通道</span>
</body>