-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsz.html
55 lines (51 loc) · 1.07 KB
/
sz.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
#data {
background: url(https://bestace.github.io/fed/ppt/demos/jsBase/img/clock.jpg);
width: 300px;
height: 300px;
background-size: 100%;
}
#mz {
height: 100px;
width: 3px;
background: red;
position: absolute;
left: 157px;
top: 158px;
transform-origin: 50% top;
}
#fz {
height: 80px;
width: 3px;
background: black;
position: absolute;
left: 157px;
top: 158px;
transform-origin: 80% top;
}
</style>
</head>
<body>
<div id="data">
<div id="fz"></div>
<div id="mz"></div>
</div>
<script type="text/javascript">
var oSec = document.getElementById("mz");
function getNow() {
now = new Date();
var hour = now.getHours();
var min = now.getMinutes();
var sec = now.getSeconds();
oSec.style.transform = "rotate(" + sec * 6 + "deg)";
setTimeout(getNow, 1000);
}
getNow();
</script>
</body>
</html>