More work on the digital clock code! Colorado

Today we begin playing around with replacing those image tags with the correct numbers, depending on what time it is.

Local Companies

Database Link LLC
303 269 1801
7125 E.Townsend Dr.
Denver, CO
Database Link LLC
303 269 1801
7125 E.Townsend Dr.
Denver, CO
21st Century Technologies, Inc.
303-744-2178
1566 S. Pennsylvania St.
Denver, CO
Rapid Refill Ink
303-292-9465
1719 Wazee St
Denver, CO
International Computer Services
720-859-0404
10 S Havana St
Aurora, CO
The Logix Group
(720) 259-7500
8801 E. Hampden Ave.
Denver, CO
EDUSS Education Software
303-779-8700
8000 E Belleview
Greenwood Village, CO
Amadeus Consulting
720 564 1231
1995 N. 57th Ct.
Boulder, CO
C Graphics
720-890-2911
8547 E. Arapahoe Rd.
Greenwood Village, CO
DENVER DATAMAN
303731-5978
1685 S. Colorado Blvd
Denver, CO

provided by: 
Originally published at Internet.com


Tips...

Last week we learned the NAMEs attached to each of the HTML image tags. Today we begin playing around with replacing those image tags with the correct numbers, depending on what time it is.

Here's the code

The time is grabbed from the user's browser, so there's no need to worry about daylight savings time or time zones. As long as the viewer has his or her browser set correctly, you're good to go. If they don't, well, you can't help that.

Let's start at the top of the script just below the loading loop and code: function clock() { dates=new Date(); hour=dates.getHours(); min=dates.getMinutes(); sec=dates.getSeconds(); if(hour < 12) { amPM=am.src; } if(hour > 11) { amPM=pm.src; hour=hour-12; } if(hour == 0) { hour=12; } if(hour < 10) { document["tensHour"].src="http://www.developer.com/dgtbl.gif"; document["Hour"].src=d[hour].src; } if(hour > 9) { document["tensHour"].src=d[1].src; document["Hour"].src=d[hour-10].src; } 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); } ...

Read article at Internet.com site

Featured Local Company

Database Link LLC

303 269 1801
7125 E.Townsend Dr.
Denver, CO
http://www.dblink.co.nz

Regional Articles
- More work on the digital clock code! Arvada CO
- More work on the digital clock code! Aurora CO
- More work on the digital clock code! Boulder CO
- More work on the digital clock code! Brighton CO
- More work on the digital clock code! Broomfield CO
- More work on the digital clock code! Canon City CO
- More work on the digital clock code! Castle Rock CO
- More work on the digital clock code! Colorado Springs CO
- More work on the digital clock code! Commerce City CO
- More work on the digital clock code! Denver CO
- More work on the digital clock code! Durango CO
- More work on the digital clock code! Englewood CO
- More work on the digital clock code! Evergreen CO
- More work on the digital clock code! Fort Collins CO
- More work on the digital clock code! Fort Morgan CO
- More work on the digital clock code! Fountain CO
- More work on the digital clock code! Golden CO
- More work on the digital clock code! Grand Junction CO
- More work on the digital clock code! Greeley CO
- More work on the digital clock code! Lafayette CO
- More work on the digital clock code! Littleton CO
- More work on the digital clock code! Longmont CO
- More work on the digital clock code! Loveland CO
- More work on the digital clock code! Montrose CO
- More work on the digital clock code! Morrison CO
- More work on the digital clock code! Parker CO
- More work on the digital clock code! Pueblo CO
- More work on the digital clock code! Sterling CO
- More work on the digital clock code! Westminster CO
- More work on the digital clock code! Wheat Ridge CO
Related Local Events
SEG - Society of Exploration Geophysicists Annual International Meeting and Exposition 2010
Dates: 10/17/2010 - 10/21/2010
Location: Denver Convention Center
Denver, CO
View Details

INTC 2009
Dates: 9/21/2009 - 9/24/2009
Location: Hyatt Convention Center Hotel
Denver, CO
View Details

RetailVision Fall 2009
Dates: 8/30/2009 - 9/3/2009
Location: Hyatt Regency Denver
Denver, CO
View Details

SANS Rocky Mountain 2009
Dates: 7/7/2009 - 7/13/2009
Location: Grand Hyatt Denver
Denver, CO
View Details

15th International Conference on Solid-State Sensors, Actuators and Microsystems (Transducers 2009)
Dates: 6/21/2009 - 6/25/2009
Location: Sheraton Denver Downtown Hotel
Denver, CO
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