<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>
Untitled Document
</title>
<style>
. sz{background: #FC9; border-radius:50%; width:200px; height:200px; position:relative;}
. hours{Position:absolute; width:6px; height:40px; Background-color: #000;
left:97px; bottom:100px; Transform:rotate (0DEG); Transform-origin:bottom;}
. minutes{Position:absolute; width:4px; height:50px; Background-color: #6CF; left:98px;
bottom:100px; Transform:rotate (0DEG); Transform-origin:bottom;} . seconds{
Position:absolute; width:2px; height:70px; Background-color: #F66; left:99px;
bottom:100px; Transform:rotate (0DEG); Transform-origin:bottom;} . one{height:20px;
width:5px; Position:absolute; Background-color: #633; left:97.5px;} . two{
height:20px; width:5px; Position:absolute; Background-color: #633; left:97.5px;
top:180px;} . three{width:20px; height:5px; position:absolute; Background-color: #633;
left:0; top:97.5px;} . four{width:20px; height:5px; position:absolute;
Background-color: #633; left:180px; top:97.5px;}
</style>
<body>
<p id= "pid" >
3232
</p>
<input onclick= "Clearcolck ()" Name= "" value= "button" type= "buttons"/>
<div class= "sz" >
<div class= "Szup" >
<div id= "Hours" class= "hours" >
</div>
<div id= "Minutes" class= "Minutes" >
</div>
<div id= "Seconds" class= "seconds" >
</div>
</div>
<div class= "Szdown" >
<div class= "One" >
</div>
<div class= "both" >
</div>
<div class= "three" >
</div>
<div class= "Four" >
</div>
</div>
</div>
</body>
<script>
var colck = SetInterval ("Time ()", 100);
function Time () {
var mytime = new Date;
var h = mytime.gethours ();
var m = mytime.getminutes ();
var s = mytime.getseconds ();
var m = math (m);
var s = math (s);
document.getElementById ("pid"). InnerHTML = H + ":" + M + ":" + S;
}
function Math (i) {
if (I < 10) {
i = "0" + i;
}
return i;
}
function Clearcolck () {
Clearinterval (COLCK);
}
var yuancolck = setinterval ("Shizhen ()", 100);
function Shizhen () {
var mytime = new Date;
var h = mytime.gethours ();
var m = mytime.getminutes ();
var s = mytime.getseconds ();
var hh = document.getElementById ("hours");
var mm = document.getElementById ("minutes");
var ss = document.getElementById ("seconds");
var HDS = hdeg (h, M);
var mds = mdeg (M);
var SDS = MDEG (s);
Hh.style.transform = ' rotate (' + HDS + ' deg) ';
Mm.style.transform = ' rotate (' + mds + ' deg) ';
Ss.style.transform = ' rotate (' + SDS + ' deg) ';
}
function Hdeg (i, j) {
if (i > 12) {
i = i-12;
} else if (i = 12) {
i = 0;
} else {
i = i;
}
i = i * 30;
j = (J/60) * 30;
return i + j;
}
function Mdeg (i) {
i = i * 6;
return i;
}
</script>
CSS3+JS Disc Clock