用canvas实现时钟每秒钟旋转一次效果,效果图如下
时钟2
对应代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>时钟</title>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<style>
div {
text-align: center;
margin-top: 50px;
}
</style>
</head>
<body>
<header>
</header>
<div>
<canvas id="clock" width="500" height="500"></canvas>
</div>
<script>
var dom = document.getElementById('clock');