-
Notifications
You must be signed in to change notification settings - Fork 20
/
10.33 多种文字炫彩效果.htm
91 lines (84 loc) · 3.5 KB
/
10.33 多种文字炫彩效果.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>10.33 多种文字炫彩效果</title>
<body bgcolor="#ffffff" onLoad="initVars()">
<script>
<!--
var divs = new Array();
var da = document.all;
var start;
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);
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">
北京欢迎你!
</div>
<br>
<div id="welcome" style="color: lime">
北京欢迎你!
</div>
<br>
<div id="message" style="color: lime">
北京欢迎你!
</div>
<br>
<div id="msg2" style="color: lime">
北京欢迎你!
</div>
<br>
<div id="msg3" style="color: lime">
北京欢迎你!
</div>
</body>
</html>