Perfecting the digital clock Oregon

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

Central Telephone
509-773-4472
1505 S. Grant
Goldendale, OR
Gorge Networks
541-386-8300
616 Industrial Way
Hood River, OR
Embarq
1-800-877-1125
902 Wasco
Hood River, OR
Advantyx Software LLC
503-246-9299
6501 SW Macadam Ave
Portland, OR
Vision33
971-255-0162
The Lincoln Center, 10260 SW Greenburg Road, 4th Floor
Portland, OR
Artisan Software Tools Inc
503-245-6200
10220 SW Greenburg Rd
Portland, OR
Axis Clinical Software Inc
503-292-3022
6443 SW Beaverton Hillsdale Hwy
Portland, OR
Cendix
503.789.2676
501 4th Street, Suite 741
Lake Oswego, OR
Cascade Custom Software
503-922-0135
1000 SW Broadway
Portland, OR
Aravo Solutions
503-224-4049
2627 NW Nicolai St
Portland, 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

Central Telephone

509-773-4472
1505 S. Grant
Goldendale, OR

Regional Articles
- Perfecting the digital clock Albany OR
- Perfecting the digital clock Beaverton OR
- Perfecting the digital clock Bend OR
- Perfecting the digital clock Canby OR
- Perfecting the digital clock Central Point OR
- Perfecting the digital clock Clackamas OR
- Perfecting the digital clock Coos Bay OR
- Perfecting the digital clock Corvallis OR
- Perfecting the digital clock Eugene OR
- Perfecting the digital clock Forest Grove OR
- Perfecting the digital clock Grants Pass OR
- Perfecting the digital clock Gresham OR
- Perfecting the digital clock Hermiston OR
- Perfecting the digital clock Hillsboro OR
- Perfecting the digital clock Hood River OR
- Perfecting the digital clock Klamath Falls OR
- Perfecting the digital clock La Grande OR
- Perfecting the digital clock Lake Oswego OR
- Perfecting the digital clock Lebanon OR
- Perfecting the digital clock Mcminnville OR
- Perfecting the digital clock Medford OR
- Perfecting the digital clock Newberg OR
- Perfecting the digital clock North Bend OR
- Perfecting the digital clock Oregon City OR
- Perfecting the digital clock Pendleton OR
- Perfecting the digital clock Portland OR
- Perfecting the digital clock Prineville OR
- Perfecting the digital clock Roseburg OR
- Perfecting the digital clock Salem OR
- Perfecting the digital clock Springfield OR
- Perfecting the digital clock The Dalles OR
- Perfecting the digital clock Troutdale OR
- Perfecting the digital clock Tualatin OR
- Perfecting the digital clock West Linn OR
- Perfecting the digital clock Wilsonville OR
- Perfecting the digital clock Woodburn OR
Related Articles
- Image Proportion Script Oregon
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.
- More work on the digital clock code! Oregon
- The zones of the time zone clock Oregon
- Get It To The Text Box Oregon
- Working with a Timer in C# Oregon
- So, You Want to Layer, Huh? Part II Oregon
- Create the Clock Oregon
Related Local Events
WOOD TECHNOLOGY CLINIC & SHOW 2010
Dates: 3/9/2010 - 3/11/2010
Location: Oregon Convention Center
Portland, OR
View Details

Party in the Pinot
Dates: 7/25/2009 - 7/25/2009
Location: Oswego Hills Winery
West Linn, OR
View Details

WebVisions 2009
Dates: 5/20/2009 - 5/22/2009
Location: Oregon Convention Center
Portland, OR
View Details

Technology and IP Networking Event
Dates: 5/19/2009 - 5/19/2009
Location: Oregon Zoo
Portland, OR
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