CSS3++JS Clocks

Source: Internet
Author: User

1<! DOCTYPE html>2"en">34<meta charset="UTF-8">5<title>Document</title>6<style>7 div{8 width:200px;9 height:200px;TenBorder-radius: -%; OneBORDER:1PX Solid # the; A position:relative; - margin:5px Auto; -text-Align:center; thebox-shadow:0px 0px 20px 5px # the; -     } - Div span{ -transform-Origin:bottom Center; +     } - . sec{ + Position:absolute; ATop -%; atLeft -%; -margin-left:-2px; -margin-top:-80px; - height:80px; - width:4px; - background:red; inBorder-radius: -% -%0 0; -     } to . min{ + Position:absolute; -Top -%; theLeft -%; *margin-left:-3px; $margin-top:-60px;Panax Notoginseng height:60px; - width:6px; theBackground: # the; +Border-radius: -% -%0 0; A     } the . hou{ + Position:absolute; -Top -%; $Left -%; $margin-left:-4px; -margin-top:-40px; - height:40px; the width:8px; -Background: # the;WuyiBorder-radius: -% -%0 0; the     } - . cap{ Wu Position:absolute; -Top -%; AboutLeft -%; $margin-left:-6px; -margin-top:-6px; - height:12px; - width:12px; ABackground:radial-gradient (#ccc, #999); +Border-radius: -%; the     } - I b{ $ Position:absolute; the top:12px; theleft:-4px; the     } the</style> -<script> inWindow.onload=function () { the         varAspan=document.queryselectorall ('span'); the         varObox=document.getelementbyid ('Box'); About clock (); theSetInterval (Clock, -); the  the          for(vari =0; I < -; i++) { +             varOi=document.createelement ('I'); -Oi.style.width='6px'; the             if(i%5){Bayioi.style.height='8px'; the}Else{ theOi.innerhtml='<b>'+i/5+'</b>'; -oi.children[0].style.transform='Rotate (-'+i*6+'deg)'; -oi.style.height='16px'; the             } the              theoi.style.position='Absolute'; theoi.style.top='0px'; -oi.style.left='100px'; theOi.style.background='#000'; theoi.style.transform='Rotate ('+i*6+'deg)'; theoi.style.transformorigin='0px 100px';94  the Obox.appendchild (OI); the         } the function Clock () {98             varOdate=NewDate (); About             varH=odate.gethours (); -             varm=odate.getminutes ();101             vars=odate.getseconds ();102             varms=odate.getmilliseconds ();103             104aspan[2].style.transform='Rotate ('+( the* (h% A)/ A+m* -/ -)+'deg)'; theaspan[1].style.transform='Rotate ('+( the*m/ -+s*6/ -)+'deg)';106aspan[0].style.transform='Rotate ('+( the*s/ -+ms*6/ +)+'deg)';107         }108     };109</script> the111<body> the<div id="Box">113<spanclass="sec"></span> the<spanclass="min"></span> the<spanclass="Hou"></span> the<pclass="Cap"></p>117</div>118</body>119

CSS3++JS Clocks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.