一个显示计算机时间的钟表的程序代码
<html><head><title>钟表</title><body bgcolor=#000000>
<SCRIPT LANGUAGE="JavaScript">
fCol = 'ffffff'; //修改表框显示颜色
sCol = 'ffcc00'; //修改秒针显示颜色
mCol = 'ffffff'; //修改分针显示颜色
hCol = 'ffffff'; //修改时针显示颜色
H = '....';
H = H.split('');
M = '.....';
M = M.split('');
S = '......';
S = S.split('');
Ypos = 0;
Xpos = 0;
Ybase = 8;
Xbase = 8;
dots = 12;
ns = (document.layers)?1:0;
if (ns) {
dgts = '1 2 3 4 5 6 7 8 9 10 11 12';
dgts = dgts.split(' ');
for (i = 0; i < dots; i++) {
document.write('<layer name=nsDigits'+i+' top=0 left=0 height=30
width=30><center><font face=Arial,Verdana size=1
color='+fCol+'>'+dgts[i]+'</font></center></layer>');
}
for (i = 0; i < M.length; i++) {
document.write('<layer name=ny'+i+' top=0 left=0 bgcolor='+mCol+'
clip="0,0,2,2"></layer>');
}
for (i = 0; i < H.length; i++) {
document.write('<layer name=nz'+i+' top=0 left=0 bgcolor='+hCol+'
clip="0,0,2,2"></layer>');
}