Perfecting the digital clock Colorado

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

Database Link LLC
303 269 1801
7125 E.Townsend Dr.
Denver, CO
Database Link LLC
303 269 1801
7125 E.Townsend Dr.
Denver, CO
21st Century Technologies, Inc.
303-744-2178
1566 S. Pennsylvania St.
Denver, CO
Rapid Refill Ink
303-292-9465
1719 Wazee St
Denver, CO
International Computer Services
720-859-0404
10 S Havana St
Aurora, CO
The Logix Group
(720) 259-7500
8801 E. Hampden Ave.
Denver, CO
EDUSS Education Software
303-779-8700
8000 E Belleview
Greenwood Village, CO
Amadeus Consulting
720 564 1231
1995 N. 57th Ct.
Boulder, CO
C Graphics
720-890-2911
8547 E. Arapahoe Rd.
Greenwood Village, CO
DENVER DATAMAN
303731-5978
1685 S. Colorado Blvd
Denver, CO

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

Database Link LLC

303 269 1801
7125 E.Townsend Dr.
Denver, CO
http://www.dblink.co.nz

Related Local Events
SEG - Society of Exploration Geophysicists Annual International Meeting and Exposition 2010
Dates: 10/17/2010 - 10/21/2010
Location: Denver Convention Center
Denver, CO
View Details

INTC 2009
Dates: 9/21/2009 - 9/24/2009
Location: Hyatt Convention Center Hotel
Denver, CO
View Details

RetailVision Fall 2009
Dates: 8/30/2009 - 9/3/2009
Location: Hyatt Regency Denver
Denver, CO
View Details

SANS Rocky Mountain 2009
Dates: 7/7/2009 - 7/13/2009
Location: Grand Hyatt Denver
Denver, CO
View Details

15th International Conference on Solid-State Sensors, Actuators and Microsystems (Transducers 2009)
Dates: 6/21/2009 - 6/25/2009
Location: Sheraton Denver Downtown Hotel
Denver, CO
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