可以实现时间与PC同步的时钟。
HTML框架:
<!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>闹钟</title>
<style type="text/css">
canvas{
position:absolute;
top:10px;
left:10px;
}
</style>
</head>
<body>
<canvas id="canvas" width=“200” height="200"></canvas>
<canvas id="p_canvas" width="200" height="200"></canvas>
<script src="pp.js" type="text/javascript">
</script>
</body>
</html>
pp.js代码:
// 绘制