More work on the digital clock code! Hallandale FL

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

Local Companies

Green Code Technologies, Inc.
(954) 840-8068
11820 Miramar Parkway
Miramar, FL
Bixby Consulting Inc
(305) 829-5549
19403 NW 83rd Ct
Hialeah, FL
Teck Choice LLC
(954) 634-1000
12709 Miramar Parkway
Miramar, FL
Effective Network Solutions
(305) 512-1611
7899 W 15th Ave
Hialeah, FL
PRO Logic Systems
(305) 824-8648
15105 NW 77th Ave
Hialeah, FL
Athyron, Corp.
800-b2b-Tech
194 NE 186 Terrace
Miami, FL
Acap Software Development & Integration
954-537-0337
1061 W. Oakland Park Blvd.
Fort Lauderdale, FL
T-Mobile ~ Cobblestone Plaza
(954) 437-0079
14834 Pines Blvd
Pembroke Pines, FL
Spirit Technologies
954-237-7797
19620 Pines Blvd
Pembroke Pines, FL
Myriad Consulting Services
(305) 623-5500
5371 NW 161st St
Hialeah, FL

 

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

Athyron, Corp.

800-b2b-Tech
194 NE 186 Terrace
Miami, FL
http://www.athyron.com

Related Local Events
Wednesday Evening Referral Group
Dates: 5/5/2010 - 5/7/2010
Location: WineStyles
Coral Springs, FL
View Details

Wake Up Coral Springs Breakfast!!
Dates: 6/15/2010 - 6/15/2010
Location: Marriott Heron Bay
Coral Springs, FL
View Details

Afternoon Chamber Referral Group
Dates: 7/1/2010 - 7/1/2010
Location: The Coral Springs Chamber Office
Coral Springs, FL
View Details

Morning Chamber Referral Group Meeting
Dates: 7/22/2010 - 7/22/2010
Location: La Quinta Hotel
Coral Springs, FL
View Details

Afternoon Chamber Referral Group
Dates: 3/4/2010 - 3/4/2010
Location: The Coral Springs Chamber Office
Coral Springs, FL
View Details

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