javascript clock

Today,talk about how to make clock with javascript.Here is the sample.
The clock is walking according to your computer's time.
First,prepare the 10 png number from 0 to 9 and a background picture whatever you like.
Now we gonna layout the html file.Overall,it contain 6 images with : .
Then,we could make it looks comfort with style.css file.
Now it looks nice. But how can the number running? The last step is javascript.
Build a string to change the index of each image,using the function toDuo() to restrict the digit every two number. Then, put the string number into the image src in turn. Of course, every minute run the function tick(). In order to run it first, we should put the function at first overall.

What a nice litter project! I like it .

Popular posts from this blog

Fancyapps — easily build overlay windows with carousel

Meet Mantine: A TS-Based Open-Source React Components Library

Meet Tippy.js: The Complete Tooltip Popover Plugin