Modified a digital clock made by CSS + Js.

Source: Internet
Author: User
<! Doctype HTML> Code </Title> <style type = "text/CSS"> body { Background: #202020; Font: bold 12px Arial, Helvetica, sans-serif; Margin: 0; Padding: 0; Min-width: 960px; Color: # bbbbbb ;}. clock {width: 800px; margin: 0 auto; padding: 30px; Border: 1px solid #333; color: # fff ;}# Date {font-family: 'bebasneueregular ', arial, Helvetica, sans-serif; font-size: 36px; text-align: center; text-Shadow: 0 0 5px # 00c6ff;} ul {width: 800px; margin: 0 auto; padding: 0px; List-style: none; text-align: center;} ul Li {display: inline; font-size: 8em; text-align: center; font-family: 'bebasneuer Egular ', Arial, Helvetica, sans-serif; text-Shadow: 0 0 5px # 00c6ff ;}. SZ {width: 120px; display: block; float: Left; Height: 100px; overflow: hidden ;}. dt {width: 30px; margin-top:-6px ;} </style> <SCRIPT type = "text/JavaScript" src = "http://code.jquery.com/jquery-1.6.4.min.js"> </SCRIPT> <SCRIPT type = "text/JavaScript"> $ (document ). ready (function () {// create two variable with the names of the months and days In an array var monthnames = ["August", "August ", "August", "August", "August"]; var daynames = ["Sunday", "Monday", "Tuesday", "Wednesday ", "Thursday", "Friday", "Saturday"] // create a newdate () object var newdate = new date (); // extract the current date from date object newdate. setdate (newdate. getdate (); // output the day, date, month and year values ('{date'}.html (newdate. getfullyear () + 'Year' + (newdate. Getmonth () + 1) + "month" + newdate. getdate () + "day" + "" + daynames [newdate. getday ()]); setinterval (function () {// create a newdate () object and extract the seconds of the current time on the visitor's VaR seconds = new date (). getseconds (); // Add a leading zero to seconds value $ ("# sec" ).html (seconds <10? "0": "") + seconds); $ (". dot "). fadein (); $ (". dot "). fadeout ();}, 1000); setinterval (function () {// create a newdate () object and extract the minutes of the current time on the visitor's VaR minutes = new date (). getminutes (); // Add a leading zero to the Minutes value $ ("# min" ).html (minutes <10? "0": "") + minutes);}, 1000); setinterval (function () {// create a newdate () object and extract the hours of the current time on the visitor's VaR hours = new date (). gethours (); // Add a leading zero to the hours value $ ("# hours" example .html (hours <10? "0": "") + hours) ;}, 1000 );}); </SCRIPT> <Li id = "hours" class = "SZ"> 88 </LI> <li id = "point" class = "sz dt">: </LI> <li id = "min" class = "SZ"> 88 </LI> <li id = "point" class = "sz dt"> <SPAN class = "dot">: </span> </LI> <li id = "Sec" class = "SZ"> 88 </LI> </ul> </div> </body> </ HTML>
    • 88
    • :
    • 88
    • :
    • 88

Related Article

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.