Use the picture shown to draw a clock that can move around: the width of the picture is a single, height is scaled by the original proportions
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<script type= "Text/javascript" src= "js/jquery-1.4.4.min.js" ></script> <script type= "Text/javascript "Language=" JavaScript >
The pointer runs up function Clockrun (id,count) {
Count%=360 $ ("#" +id). CSS ("-moz-transform", "Rotate (" +count+ "deg)") $ ("#" +id). CSS ("-webkit-transform", "rotate" + Count + "deg)") $ ("#" +id). CSS ("-o-transform", "Rotate (" +count+ "deg)") $ ("#" +id). CSS ("-ms-transform", "Rotate" ("+count"). + "deg)") $ ("#" +id). CSS ("transform", "Rotate (" +count+ "deg)")}//Check time function check () {var date=new date (); var hour=date.gethours (); var mini=date.getminutes (); var secound=date.getseconds (); Angle Var count=secound*6; var count1=mini*6; var count2= (hour%12) *30+parseint (MINI/12) *6; Clockrun (' second ', count); Clockrun (' mini ', count1); Clockrun (' Hour ', count2); }//Call Window.onload=function () {
Check (); Window.setinterval ("Check ()", "1000"); }
</script>
<style>
#panel { background:url ("1.png"); position:absolute; background-position:-158px-55px; width : 587px; height:569px; background-repeat:no-repeat; top:150px; left:150px; z-index:1; &NBSP;} #second { background:url ("1.png"); position:absolute; background-position:-21px- 366px; width:23px; height:250px; background-repeat:no-repeat; top:102px; left:288.5px; z-index:4; transform-origin:11.5px 188px; -moz-transform-origin:11.5px 188px; -webkit-transform-origin:11.5px 188px; -o-transform-origin:11.5px 188px; -ms-transform-origin:11.5px 188px; } #mini { background:url ("1.png"); position:absolute; background-position:-58px -390px; width:21px; height:172px; background-repeat:no-repeat; top:128px; left:289.5px; z-index:3; transform-origin:10.5px 162px; -moz-transform-origin: 10.5px 162px; -webkit-transform-origin: 10.5px 162px; -o-transform-origin: 10.5px 162px; -ms-transform-origin:10.5px 162px; } #hour { background:url ("1.png"); position:absolute; background-position:-94px -438px; width:26px; height:127px; background-repeat:no-repeat; top:174px; left:287px; z-index:2; &NBSP;TRANSFORM-ORIGIN:13PX 116px; -moz-transform-origin: 13px 116px; -webkit-transform-origin: 13px 116px; &NBSP;-O-TRANSFORM-ORIGIN:13PX 116px; &NBSP;-MS-TRANSFORM-ORIGIN:13PX 116px; &NBSP;}
</style>
<body> <div id= "Panel" >
<div id= "Second" ></div>
<div id= "Mini" ></div>
<div id= "Hour" ></div>
</div>
</body>
Use a picture to draw a clock that moves around