Perfecting the digital clock New Hampshire

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

QED Connect
(603)881-3884
2 Townsend West Unit 1
Nashua, NH
Advanced Network Associates Inc
(603) 894-6486
5 Manor Pkwy
Salem, NH
Strafford Technology Inc
(603) 434-2550
1D Commons Dr Unit 20
Londonderry, NH
Technology Consultants Inc
(603) 594-3737
15 Tanguay Ave
Nashua, NH
Longhorn Steakhouse
(603) 579-6975
101 State Route 101A
Amherst, NH
Edi Sciences
(603) 672-9304
Amherst, NH
Flanders Donna Comptr Consltnt
(603) 823-9509
216 Butterhill Rd
Franconia, NH
Clearbridge Technology Group Llc
(603) 791-4173
29 Chagnon Ln
Hudson, NH
Datamatics
(603) 598-1217
20 Trafalgar Sq Ste 445
Nashua, NH
Dumont Associates Inc
(603) 883-9400
15B Charron Ave
Nashua, NH

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

QED Connect

SaaS provider for the mobile work force

(603)881-3884
2 Townsend West Unit 1
Nashua, NH
www.qedconnect.com

QED Connect, Inc. is an information security Software-as-a-Service (SaaS) provider that gives organizations visibility, management and control of activity on all their computers, laptops and wireless devices. The company’s popular SaaS, Omni Manager, is an affordable way to monitor and manage how employees are using company computers and the Internet at any time, from any location in the world. This solves the problems created by today’s ‘virtual’ work environment of branch offices, remote workers and traveling employees. Omni Manager is a web-hosted software application that includes e-mail and Internet filtering and blocking, antivirus, instant messaging management, asset tracking, application usage monitoring and policy management. ROI is delivered by employee productivity gains, cost savings and improved operational efficiencies.

Related Local Events
Thin Film & Crystal Growth Mechanisms 2009
Dates: 7/12/2009 - 7/17/2009
Location: Colby Sawyer College
New London, NH
View Details

Physical Organic Chemistry 2009
Dates: 6/28/2009 - 7/3/2009
Location: Holderness School
Plymouth, NH
View Details

Atomic Physics 2009
Dates: 6/28/2009 - 7/3/2009
Location: Tilton School
Tilton, NH
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