2 <!-- MOZ_INSERT_CONTENT_HOOK -->
3 <title>DOM, CSS and Fonts - Sample Code: Animating Fonts with DOM
</title>
7 el
=0; // Index of the element.
8 anicounter
=0; // Frame counter.
9 colorvalue
=255; // Aux color value.
12 function mzDhtmlStart()
14 startTime
= Date
.now();
20 // This is a 20-steps animation procedure.
24 currentSpace
=parseFloat(document
.getElementById("text"+el
).style
.letterSpacing
);
26 document
.getElementById("text"+el
).style
.letterSpacing
=currentSpace
+"px";
30 document
.getElementById("text"+el
).style
.color
="rgb("+colorvalue
+","+colorvalue
+","+colorvalue
+")";
31 posleft
=parseInt(document
.getElementById("text"+el
).style
.left
);
33 document
.getElementById("text"+el
).style
.left
=posleft
+"px";
34 setTimeout("fadein()", 0);
49 currentSpace
=parseFloat(document
.getElementById("text"+el
).style
.letterSpacing
);
51 document
.getElementById("text"+el
).style
.letterSpacing
=currentSpace
+"px";
55 document
.getElementById("text"+el
).style
.color
="rgb("+colorvalue
+","+colorvalue
+","+colorvalue
+")";
56 posleft
=parseInt(document
.getElementById("text"+el
).style
.left
);
58 document
.getElementById("text"+el
).style
.left
=posleft
+"px";
59 setTimeout("fadeout()", 0);
70 tpRecordTime(Date
.now() - startTime
);
75 <body onload=
"mzDhtmlStart();" bgcolor=
"white">
77 <div id=
"text0" style=
"position: absolute; top: 0px; font-size: 16pt; letter-spacing: 9px; color: rgb(255,255,255); left: 40px;">Netscape Communications
</div>
78 <div id=
"text1" style=
"position: absolute; top: 50px; font-size: 16pt; letter-spacing: 9px; color: rgb(255,255,255); left: 90px;">Gecko - Link Different
</div>
79 <div id=
"text2" style=
"position: absolute; top: 100px; font-size: 16pt; letter-spacing: 9px; color: rgb(255,255,255); left: 140px;">Cool Demos and Fades
</div>
80 <div id=
"text3" style=
"position: absolute; top: 150px; font-size: 16pt; letter-spacing: 9px; color: rgb(255,255,255); left: 190px;">Dynamic Font Spacing
</div>
81 <div id=
"text4" style=
"position: absolute; top: 200px; font-size: 16pt; letter-spacing: 9px; color: rgb(255,255,255); left: 240px;">Cool Gecko Technology
</div>