查看完整版本: 高閃亮字

fend631 2008-3-9 17:15

高閃亮字

[quote]要完成此效果把如下代碼加入到<body>區域中'D4L reYU)Vt7g
<span id="theText" style="width:100%"> CY,K'K)e5B#j g
<h2>JavaScript Fairyland</h2>-KG3d&g%V
</span>
3@.e8T!Jb]X <script>
l-@O1^/w <!--
l,Kj`ZU //range of glowing
aA ]L4[qXm var from = 5;
c _ Ae!` var to = 11;R z J+S*yM0^UTM
//speed of pulsing
0w N+_bw-t6}#f;p C var delay = 55;
l(I^Db //color of glow, name or RGB value (example:'#00FF00')0z7r!{!S r)SBR3y[3?t
var glowColor = "lime";
9cP9kBt"}!Mj //NO MORE EDITING!!!/{U^ u&W'r9w
var i = to;
#^2B0^E)r var j = 0;
j5i0GN bF;^ //can be called here or whenever you want the text to start pulsing
6^6T/^;T;O8L(zLc textPulseDown();
(t;MP2m C?5r{ function textPulseUp()
#AI-w#I;c/y {
raWD{*\@ if (!document.all)
p(R4W P My?)Kg returnSn1rbh
if (i < to)3bMU.\JF.ttT
{4wk}.\)c GD
theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";
cuPv-A FpC i++;
`k;A V La}+? @\ theTimeout = setTimeout('textPulseUp()',delay);
,remi|wB;Y return 0;]*J)[ `A Cw*HUF
}+Uv~;i_ v/DEQ+q/T
if (i = to)E^R"p'{[T
{
3wZ5uww)F theTimeout = setTimeout('textPulseDown()',delay);
;V_0k!`-U return 0;TwMx"QD`(\
}:~&Len+U ]G&jb
}
7\4d/jpa9l G function textPulseDown()pX2bKCik
{
r9pNU8R'Yy if (!document.all)
kV`M| aob return
K&rl-~'X JXat if (i > from) fMB%K JYe}Hm)q
{a5r$Xf)y:g2I
theText.style.filter = "Glow(Color=" + glowColor + ", Strength=" + i + ")";.` eS7_E GUa1d
i--;!Ni6fyO Z
theTimeout = setTimeout('textPulseDown()',delay);c5H} l$z x
return 0;
#sJ%?'f"n%{ }
/e&B]\ g#c if (i = from)
#u9O*NvN} { ioV,QKT4?4uy
theTimeout = setTimeout('textPulseUp()',delay);
H.ZT+_I S&Si5z return 0;
~;f-a I5u }
TA#s:]Lz }
I7p;z&YM;of //-->
m5h"a_C'FKlO </script>[/quote]
頁: [1]
查看完整版本: 高閃亮字