More work on the digital clock code! Delray Beach FL

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

Local Companies

Palm Beach Software Design, Inc.
572-0233
1101 N. Congress Ave., Ste. 202
Boynton Beach, FL
Computer Resolutions
582-5588 phone/fax
104 Half Moon Circle, #C-3
Lantana, FL
Midrange Support & Service
(561) 272-5883
1118 E Atlantic Ave
Delray Beach, FL
Systems Design & Support Inc
(561) 279-2627
401 Linton Blvd
Delray Beach, FL
Orgalogic Mgmt
(561) 243-6330
25 Seabreeze Ave
Delray Beach, FL
Can Do Networking
369-7748
706 W. Boynton Beach Blvd., #114
Boynton Beach, FL
Palm Beach Software Design, Inc.
572-0233
1101 N. Congress Ave., Ste. 202
Boynton Beach, FL
NetOne Technologies, Inc.
432-7823
7403 Langston Ct.
Lake Worth, FL
Mas Consulting Inc
(561) 381-5050
8108 Laurel Ridge Ct
Delray Beach, FL
Inzon Corporation
(561) 279-8200
238 NE 1st Ave
Delray Beach, 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

Can Do Networking

369-7748
706 W. Boynton Beach Blvd., #114
Boynton Beach, FL

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