Perfecting the digital clock Albany OR

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

Northwest Software Inc
(503) 629-5947
Beaverton, OR
PC Technical Service
(503) 636-9388
Lake Oswego, OR
Db Professionals Inc
(503) 223-4861
620 SW 5th Ave Ste 610
Portland, OR
L & R Pro-Mo
(541) 544-2380
Tygh Valley, OR
Cascade Networking Llc
(541) 617-0553
19800 Village Office Ct
Bend, OR
Helion Software
(503) 363-8254
1431 Liberty St SW
Albany, OR
Legato Systems Inc
(503) 977-6165
10260 SW Greenburg Rd Ste 400
Portland, OR
Portland Computer Guys Llc
(503) 681-8098
Hillsboro, OR
Digital Infrastructures
(503) 535-8086
1001 SW 5th Ave
Portland, OR
Jot Object Technologies
(541) 482-9541
Ashland, OR

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

Jada Management Systems

(503) 744-0710
19775 Derby Street
West Linn, OR
http://www.jadaman.com

3PLs, Freight Forwarders, Manufacturers, and distributors in 12 countries have discovered that managing a supply chain does not have to be a time consuming, high cost, or high risk venture.

SCP 4.0 is designed to overcome the integration difficulties, technical resource constraints, and economics of implementing and running supply chain planning systems.

USER FRIENDLY, IT FRIENDLY, CFO FRIENDLY
SCP combines power, simplicity, flexibility & intuitiveness.

UNRIVALED IMPLEMENTATION SPEED
Our unique integration capabilities allow SCP to be fully implemented in an average of 2 weeks at an all inclusive cost of less than $55,000. Designed to overcome integration difficulties and resource constraints, SCP implements at a fraction of the time and cost of competing products.

QUICK ROI
Competitive pricing and unique features allow clients the luxury of instant gratification and a 6-12 month return on their investment

SCP… Work Smarter

Related Articles
- Image Proportion Script Albany OR
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.
- So, You Want to Layer, Huh? Part II Albany OR
- The zones of the time zone clock Albany OR
- Get It To The Text Box Albany OR
- Working with a Timer in C# Albany OR
- More work on the digital clock code! Albany OR
- Create the Clock Albany OR
Related Articles
- Image Proportion Script Albany OR
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.
- So, You Want to Layer, Huh? Part II Albany OR
- The zones of the time zone clock Albany OR
- Get It To The Text Box Albany OR
- Working with a Timer in C# Albany OR
- More work on the digital clock code! Albany OR
- Create the Clock Albany OR

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