Perfecting the digital clock Indiana

We're in the home stretch with the digital clock script. All we need to do now is set the minutes and seconds.

Local Companies

Bell Industries Technology Solutions Group
317-704-6000
8888 Keystone Xing
Indianapolis, IN
GT Solutions
317-844-3510
250 E 96th St
Indianapolis, IN
Peartree Software Consulting
317-257-2486
600 Holliday Ln
Indianapolis, IN
Professional Solutions
317-255-1944
2040 E 54th St
Indianapolis, IN
Sanyog Computer Solutions
317-579-0746
8650 Malaga DR
Indianapolis, IN
Seven Opals Software LLC
317-569-1810
1537 Sierra Spgs
Indianapolis, IN
Sterling Creek Software
317-567-5060
5881 E 82nd St
Indianapolis, IN
Advanced Solutions Inc
260-432-9695
7030 Pointe Inverness Way
Fort Wayne, IN
Britannia Inc
260-482-6321
1616 Directors Row
Fort Wayne, IN
CBS Computer Repair
260-441-9000
2727 Stardale Dr
Fort Wayne, IN

provided by: 
Originally published at Internet.com


Tips... We're in the home stretch. We've grabbed the time, set the returns into numbers we can play with and used those numbers to post the AM/PM image and the two hour images. Now we'll set the minutes and seconds.

Here's the code

Here's the code we're interested in:

if(min < 10) { document["tensMin"].src=d[0].src; } if(min > 9) { document["tensMin"].src=d[parseInt(min/10,10)].src; } document["Min"].src=d[min%10].src; if(sec < 10) { document["tensSec"].src=d[0].src; } if(sec > 9) { document["tensSec"].src=d[parseInt(sec/10,10)].src; } document["Sec"].src=d[sec%10].src; document["amPM"].src=amPM; setTimeout("clock();",100);

The script plays with the minutes and seconds in the same way it did the hours, through "if" statements.

If the minute return is less than "tensMIN" (the first minute image), it is set to d0.src. If you look back up the script, you'll see that is the dgt0.gif.

If the minute is more than nine, then we need to get the correct 10 number in the "tensMin" position. We already know that the minute return is 10 or above so we need either 1, 2, 3, 4, or 5. The little math equation parseInt(min/10,10) does the trick...

Read article at Internet.com site

Featured Local Company

Bell Industries Technology Solutions Group

317-704-6000
8888 Keystone Xing
Indianapolis, IN

Related Articles
- Image Proportion Script Indiana
Enter height and width of an image to resize. Then enter a new height; the script figures the new width, keeping the same proportions the image original had.
- Working with a Timer in C# Indiana
- So, You Want to Layer, Huh? Part II Indiana
- Create the Clock Indiana
- The zones of the time zone clock Indiana
- More work on the digital clock code! Indiana
- Get It To The Text Box Indiana
Regional Articles
- Perfecting the digital clock Anderson IN
- Perfecting the digital clock Angola IN
- Perfecting the digital clock Bedford IN
- Perfecting the digital clock Bloomington IN
- Perfecting the digital clock Brazil IN
- Perfecting the digital clock Brownsburg IN
- Perfecting the digital clock Carmel IN
- Perfecting the digital clock Chesterton IN
- Perfecting the digital clock Columbia City IN
- Perfecting the digital clock Columbus IN
- Perfecting the digital clock Connersville IN
- Perfecting the digital clock Crawfordsville IN
- Perfecting the digital clock Crown Point IN
- Perfecting the digital clock Dyer IN
- Perfecting the digital clock East Chicago IN
- Perfecting the digital clock Elkhart IN
- Perfecting the digital clock Evansville IN
- Perfecting the digital clock Fishers IN
- Perfecting the digital clock Fort Wayne IN
- Perfecting the digital clock Franklin IN
- Perfecting the digital clock Gary IN
- Perfecting the digital clock Goshen IN
- Perfecting the digital clock Granger IN
- Perfecting the digital clock Greenfield IN
- Perfecting the digital clock Greenwood IN
- Perfecting the digital clock Hammond IN
- Perfecting the digital clock Hobart IN
- Perfecting the digital clock Huntington IN
- Perfecting the digital clock Indianapolis IN
- Perfecting the digital clock Jeffersonville IN
- Perfecting the digital clock Kendallville IN
- Perfecting the digital clock Kokomo IN
- Perfecting the digital clock Lafayette IN
- Perfecting the digital clock Laporte IN
- Perfecting the digital clock Logansport IN
- Perfecting the digital clock Marion IN
- Perfecting the digital clock Martinsville IN
- Perfecting the digital clock Merrillville IN
- Perfecting the digital clock Michigan City IN
- Perfecting the digital clock Mishawaka IN
- Perfecting the digital clock Muncie IN
- Perfecting the digital clock Munster IN
- Perfecting the digital clock New Albany IN
- Perfecting the digital clock New Castle IN
- Perfecting the digital clock Newburgh IN
- Perfecting the digital clock Noblesville IN
- Perfecting the digital clock North Vernon IN
- Perfecting the digital clock Peru IN
- Perfecting the digital clock Portage IN
- Perfecting the digital clock Richmond IN
- Perfecting the digital clock Schererville IN
- Perfecting the digital clock Seymour IN
- Perfecting the digital clock Shelbyville IN
- Perfecting the digital clock South Bend IN
- Perfecting the digital clock Terre Haute IN
- Perfecting the digital clock Valparaiso IN
- Perfecting the digital clock Vincennes IN
- Perfecting the digital clock Wabash IN
- Perfecting the digital clock Warsaw IN
- Perfecting the digital clock West Lafayette IN
- Perfecting the digital clock Zionsville IN
Related Local Event
Live, Learn, & Intern - XBOX Tournament @ Aptera
Dates: 7/30/2009 - 7/30/2009
Location: Aptera Software, Inc.
Fort Wayne, IN
View Details

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML