<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML5制作简单的钟表</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<h2 class="title"><a href="#">教程:HTML5制作简单的钟表</a></h2>
<p>注意:您必须使用现代浏览器才能看到效果,IE8及以下版本不支持。</p>
<canvas id="clock" width="400" height="400"></canvas>
<script type="text/javascript">
var m = time.getMinutes();
var s = time.getSeconds();
h = h > 12 ? (h - 12) * 5 + parseInt(m / 12) : h * 5 + parseInt(m / 12);