这是一个用PHP生成的纯JavaScript时钟
PHP代码不长,但是JavaScript代码就比较长了。
大家可以到http://disapart.oso.com.cn/temp/clock.php预览
也可以到http://disapart.oso.com.cn/temp/clock.txt下载原文件
$height = 200;
$width = 200;
$left = 100;
$top = 100;
?>
My Clock Example
divShi echo $t; ?>.style.top = getPos ( echo $t; ?> ,shi+fen/12,50,0);
divShi echo $t; ?>.style.left = getPos ( echo $t; ?> ,shi+fen/12,50,1);
divFen echo $t; ?>.style.top = getPos ( echo $t; ?> ,fen ,75,0);
divFen echo $t; ?>.style.left = getPos ( echo $t; ?> ,fen ,75,1);
divMiao echo $t; ?>.style.top = getPos ( echo $t; ?> ,miao,99,0);
divMiao echo $t; ?>.style.left = getPos ( echo $t; ?> ,miao,99,1);
}
?>
setTimeout("onidle();",250);
}
//function_onidle_end
for($t=0;$t{
?>
style="z-index:4;position:absolute;"> echo $t; ?>
style="z-index:3;position:absolute;"> echo $t*5; ?>
style="z-index:2;position:absolute;"> echo $t*5; ?>
}
?>