Put together a digital clock
A previous Script Tip, " Running Digital Clock " shows a nice running clock.
Take a look at the code:
Right up front, you're going to need some images.
Click here to get the images
The names of the numbers speak for themselves. The A and the P are for AM and PM, the dgtcol image is the colon column and the dgtbl is the blank image that shows up when nothing is called for. It's also the default image. It shows up even if the script doesn't run. You'll see that in the image code.
And speaking of that code:
Now, you may have noticed that I have them listed vertically, but in the code they're all in one big long line. When you put this on your page, go with the big long line. The reason is that browsers will often mistake that carriage return as a space. If that happens, there will be a space between each number and the effect will die.
You'll notice I've broken out the dgtcol images. They never change, so at this point, we need not worry about them.
The two hour numbers are broken down into "tensHour" and "Hour". The minutes are done the same way, "tensMin" and "Min". Seconds follow along, "tensSec" and "Sec".
The final digit is the "amPM" image.
Now that we have the image code down, let's load those pups.
Next Week: Post the Images