Perfecting the digital clock Virginia

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

IBM Corp
(757) 446-6200
999 Waterside DR
Norfolk, VA
Digital Image Technology Corp
(757) 623-3709
500 E Plume St
Norfolk, VA
Electronics Boutique
757-465-5977
4200 Portsmouth Blvd
Chesapeake, VA
Paramount Technology Group Inc
757-405-0110
3909 Colony Pointe DR
Chesapeake, VA
Active Computer & Electronics
757-558-8878
2981 S Military Hwy
Chesapeake, VA
Software Development & Services Corporation
703-359-1380
2200 Wilson Blvd
Arlington, VA
Geeks On Call America
(757) 722-3200
814 Kempsville Rd
Norfolk, VA
Patriot Computers
(757) 587-6400
7862 Tidewater Dr
Norfolk, VA
Direct2U Computer Repair
757-803-8126
4213 Schooner Trail
Chesapeake, VA
Torrential Data Solutions Inc
757-222-2000
5604 Virginia Beach Blvd
Virginia Beach, VA

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

IBM Corp

(757) 446-6200
999 Waterside DR
Norfolk, VA

Related Articles
- Image Proportion Script Virginia
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! Virginia
- Get It To The Text Box Virginia
- The zones of the time zone clock Virginia
- Working with a Timer in C# Virginia
- Create the Clock Virginia
- So, You Want to Layer, Huh? Part II Virginia
Regional Articles
- Perfecting the digital clock Alexandria VA
- Perfecting the digital clock Annandale VA
- Perfecting the digital clock Arlington VA
- Perfecting the digital clock Ashburn VA
- Perfecting the digital clock Bassett VA
- Perfecting the digital clock Blacksburg VA
- Perfecting the digital clock Bristol VA
- Perfecting the digital clock Burke VA
- Perfecting the digital clock Centreville VA
- Perfecting the digital clock Chantilly VA
- Perfecting the digital clock Charlottesville VA
- Perfecting the digital clock Chesapeake VA
- Perfecting the digital clock Chester VA
- Perfecting the digital clock Chesterfield VA
- Perfecting the digital clock Christiansburg VA
- Perfecting the digital clock Colonial Heights VA
- Perfecting the digital clock Culpeper VA
- Perfecting the digital clock Danville VA
- Perfecting the digital clock Dumfries VA
- Perfecting the digital clock Fairfax Station VA
- Perfecting the digital clock Fairfax VA
- Perfecting the digital clock Falls Church VA
- Perfecting the digital clock Farmville VA
- Perfecting the digital clock Fredericksburg VA
- Perfecting the digital clock Front Royal VA
- Perfecting the digital clock Galax VA
- Perfecting the digital clock Glen Allen VA
- Perfecting the digital clock Hampton VA
- Perfecting the digital clock Harrisonburg VA
- Perfecting the digital clock Herndon VA
- Perfecting the digital clock Hopewell VA
- Perfecting the digital clock King George VA
- Perfecting the digital clock Leesburg VA
- Perfecting the digital clock Lorton VA
- Perfecting the digital clock Lynchburg VA
- Perfecting the digital clock Manassas VA
- Perfecting the digital clock Martinsville VA
- Perfecting the digital clock Mc Lean VA
- Perfecting the digital clock Mechanicsville VA
- Perfecting the digital clock Midlothian VA
- Perfecting the digital clock Newport News VA
- Perfecting the digital clock Norfolk VA
- Perfecting the digital clock Petersburg VA
- Perfecting the digital clock Portsmouth VA
- Perfecting the digital clock Powhatan VA
- Perfecting the digital clock Radford VA
- Perfecting the digital clock Reston VA
- Perfecting the digital clock Richmond VA
- Perfecting the digital clock Roanoke VA
- Perfecting the digital clock Salem VA
- Perfecting the digital clock Spotsylvania VA
- Perfecting the digital clock Springfield VA
- Perfecting the digital clock Stafford VA
- Perfecting the digital clock Staunton VA
- Perfecting the digital clock Sterling VA
- Perfecting the digital clock Suffolk VA
- Perfecting the digital clock Vienna VA
- Perfecting the digital clock Vinton VA
- Perfecting the digital clock Virginia Beach VA
- Perfecting the digital clock Warrenton VA
- Perfecting the digital clock Waynesboro VA
- Perfecting the digital clock Williamsburg VA
- Perfecting the digital clock Winchester VA
- Perfecting the digital clock Woodbridge VA
- Perfecting the digital clock Yorktown VA
Related Local Events
SANS Virginia Beach 2009
Dates: 8/28/2009 - 9/4/2009
Location: Sheraton Oceanfront Virginia Beach
Virginia Beach, VA
View Details

The 2009 Federal Technology Policy Forum
Dates: 7/15/2009 - 7/17/2009
Location: The Performance Institute
Arlington, VA
View Details

4th Annual Military Armor Protection
Dates: 6/23/2009 - 6/26/2009
Location: Hilton McLean
Tysons Corner, VA
View Details

Coalition Warfighter Interoperability Demonstration
Dates: 6/15/2009 - 6/26/2009
Location: Joint Systems Integration Center
Suffolk, VA
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