Perfecting the digital clock Antioch CA

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

e-Zest Inc.
+1 415 806 0340
1555 Riviera Ave, #324
Walnut Creek, AK
Corporate Network Planning Inc
(925) 777-0130
Antioch, CA
Computer Support Source
(925) 776-4776
2716 Lobelia Ct
Antioch, CA
Nexlevel Information Technology Inc
(916) 851-5850
2890 Kilgore Rd
Rancho Cordova, CA
Real Estate Technology Services Llc
(408) 845-9192
3160 De La Cruz Blvd
Santa Clara, CA
Exadel
925 602 5571
1850 Gateway Blvd.
Concord, CA
Heinsua Computer Consulting Service
(925) 754-6453
5149 Arroyo Way
Antioch, CA
Shoestring Consulting
(925) 978-7463
3025 Butternut St
Antioch, CA
Digital Keystone Inc
(650) 938-7303
1975 W El Camino Real
Mountain View, CA
Professional Practice Systems Inc
(562) 804-7674
9604 Artesia Blvd
Bellflower, CA

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

Exadel

925 602 5571
1850 Gateway Blvd.
Concord, CA
http://www.exadel.com

Related Local Events
Contraceptive Technology Conference : San Francisco
Dates: 3/24/2010 - 3/27/2010
Location: Hyatt Regency Hotel
San Francisco, CA
View Details

Advanced Lithography
Dates: 2/21/2010 - 2/26/2010
Location: San Jose Convention Center
San Jose, CA
View Details

Informex USA
Dates: 2/16/2010 - 2/19/2010
Location: Moscone Convention Center, San Francisco
San Francisco, CA
View Details

MACWORLD 2010
Dates: 1/4/2010 - 1/8/2010
Location: Moscone Convention Center
San Francisco, CA
View Details

Web 2.0 Summit
Dates: 10/20/2009 - 10/22/2009
Location: Westin San Francisco Market Street
San Francisco, CA
View Details

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