精彩的多种文字阴影效果,而且阴影还在不停抖动,酷

发布时间:2007年01月24日      浏览次数:1422 次
脚本说明:
第一步:把如下代码加入<body>区域中
<script>
<!--
var divs = new Array();
var da = document.all;
var start;
//CONFIGUER THESE VARS!!!!!!
//speed of pulsing
var speed = 50;
function initVars(){
if (!document.all)
return
addDiv(hi,"lime",2,11);
addDiv(welcome,"red",4,9);
addDiv(message,"purple",2,4);
addDiv(msg2,"orange",15,17);
addDiv(msg3,"blue",1,3);
//NO MORE EDITING!!!!!!
startGlow();
}
function addDiv(id,color,min,max)
{
var j = divs.length;
divs[j] = new Array(5);
divs[j][0] = id;
divs[j][1] = color;
divs[j][2] = min;
divs[j][3] = max;
divs[j][4] = true;
}
function startGlow()
{
      if (!document.all)
            return 0;
      for(var i=0;i<divs.length;i++)
      {
            divs[i][0].style.filter = "Glow(Color=" + divs[i][1] + ", Strength=" + divs[i][2] + ")";
            divs[i][0].style.width = "100%";
      }
      start = setInterval('update()',speed);
}
function update()
{
      for (var i=0;i<divs.length;i++)
      {
            if (divs[i][4])
            {
                  divs[i][0].filters.Glow.Strength++;
                  if (divs[i][0].filters.Glow.Strength == divs[i][3])
                        divs[i][4] = false;
            }
      
            if (!divs[i][4])
            {
                  divs[i][0].filters.Glow.Strength--;
                  if (divs[i][0].filters.Glow.Strength == divs[i][2])
                        divs[i][4] = true;
            }
      }
}
-->
</script>
<div id="hi" style="color: lime">
Hello!
</div>

<div id="welcome" style="color: lime">
Welcome!你好!
</div>

<div id="message" style="color: lime">
This is a pulsating message!
</div>

<div id="msg2" style="color: lime">
This is another pulsating message!
</div>

<div id="msg3" style="color: lime">
This is yet another pulsating message!
</div>
第二步:请把<body>中的内容改为:
<body bgcolor="#fef4d9" onLoad="initVars()">
文章来源:http://www.baron.com.cn/javascript/text/20020109text2.htm
免责声明:本站相关技术文章信息部分来自网络,目的主要是传播更多信息,如果您认为本站的某些信息侵犯了您的版权,请与我们联系,我们会即时妥善的处理,谢谢合作!