JS implementation of dynamic picture clock

Source: Internet
Author: User

Effects such as

Attachment has picture http://files.cnblogs.com/files/biyongyao/clock. rar

Source

1<! DOCTYPE html>234<meta charset= "Utf-8" >5<meta http-equiv= "x-ua-compatible" content= "ie=edge,chrome=1" >6<title>Examples</title>7<style type= "Text/css" >8 body{9 Background:black;Ten Color:white; One     } A</style> -<script> -     functionTonum (num)//to show the status of 01 when it is single-digit the     { -        if(num<10) -{return' 0 ' +num;} -        Else +{return""+num;} -  +     } AWindow.onload=function() at     { -         -         varObj=document.getelementsbytagname ("img"); -         functionTick () -         { -              varTime=NewDate (); in              varTime1=tonum (Time.gethours ()) +tonum (Time.getminutes ()) +tonum (Time.getseconds ());//gets a string of hour minute seconds -              //Console.log (time1); to              for(vari=0;i<obj.length;i++)//one has six pictures, the first two represent the hour, the middle two stands for the minute, the last two represent the second, +                 { -obj[i].src=time1[i]+ '. png ';//what the time string is, what picture is displayed the                 } *         } $Window.setinterval (tick, 1000);Panax NotoginsengTick ();//in order to start not showing 000000 -         the          +     } A</script> the  + -<body> $ $ - : - the - :Wuyi the -      Wu</body> -

JS implementation of dynamic picture clock

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.