More work on the digital clock code! South Carolina

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

Local Companies

Charlotte Web Design & Development
(704) 577-8242
Commodore point rd
Lake Wylie, SC
Pinnacle Consulting LLC
803 629 5243
98 Groves Wood Ct
Columbia, SC
Coastal Technology Group/CTG Consulting
(704) 609-4091
4522 Firethorne Drive
Murrells Inlet, SC
Sim Inc
(843) 745-0771
1019 Bankton Cir
Hanahan, SC
Net Solutions Technology Center Llc
(843) 525-6469
38 Sams Point Rd
Beaufort, SC
Byte Software Llc
(864) 288-7206
317 New Neely Ferry Rd
Mauldin, SC
Sterling Software Systems Inc
(803) 407-3680
130 Centrum Dr
Irmo, SC
Friendly Computers
(843) 236-0909
Myrtle Beach, SC
Transyst Inc
(843) 235-2600
Pawleys Island, SC
Capital Software Consultants
(803) 738-7027
2700 Middleburg Dr Ste 218
Columbia, SC

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

Charlotte Web Design & Development

7045778242
Commodore point rd
Lake Wylie, SC
http://www.charlottewebdevelopment.com

Regional Articles
- More work on the digital clock code! Aiken SC
- More work on the digital clock code! Anderson SC
- More work on the digital clock code! Beaufort SC
- More work on the digital clock code! Bennettsville SC
- More work on the digital clock code! Bluffton SC
- More work on the digital clock code! Boiling Springs SC
- More work on the digital clock code! Charleston SC
- More work on the digital clock code! Clemson SC
- More work on the digital clock code! Clover SC
- More work on the digital clock code! Columbia SC
- More work on the digital clock code! Conway SC
- More work on the digital clock code! Darlington SC
- More work on the digital clock code! Dillon SC
- More work on the digital clock code! Easley SC
- More work on the digital clock code! Florence SC
- More work on the digital clock code! Fort Mill SC
- More work on the digital clock code! Fountain Inn SC
- More work on the digital clock code! Gaffney SC
- More work on the digital clock code! Gaston SC
- More work on the digital clock code! Georgetown SC
- More work on the digital clock code! Goose Creek SC
- More work on the digital clock code! Greenville SC
- More work on the digital clock code! Greenwood SC
- More work on the digital clock code! Greer SC
- More work on the digital clock code! Hartsville SC
- More work on the digital clock code! Hilton Head Island SC
- More work on the digital clock code! Inman SC
- More work on the digital clock code! Irmo SC
- More work on the digital clock code! Ladson SC
- More work on the digital clock code! Lancaster SC
- More work on the digital clock code! Laurens SC
- More work on the digital clock code! Lexington SC
- More work on the digital clock code! Manning SC
- More work on the digital clock code! Moncks Corner SC
- More work on the digital clock code! Mount Pleasant SC
- More work on the digital clock code! Murrells Inlet SC
- More work on the digital clock code! Myrtle Beach SC
- More work on the digital clock code! Newberry SC
- More work on the digital clock code! North Augusta SC
- More work on the digital clock code! North Charleston SC
- More work on the digital clock code! Orangeburg SC
- More work on the digital clock code! Pickens SC
- More work on the digital clock code! Piedmont SC
- More work on the digital clock code! Rock Hill SC
- More work on the digital clock code! Seneca SC
- More work on the digital clock code! Simpsonville SC
- More work on the digital clock code! Spartanburg SC
- More work on the digital clock code! Summerville SC
- More work on the digital clock code! Sumter SC
- More work on the digital clock code! Taylors SC
- More work on the digital clock code! Travelers Rest SC
- More work on the digital clock code! Walterboro SC
- More work on the digital clock code! West Columbia SC
Related Local Event
Information Technology Council
Dates: 11/10/2009 - 11/10/2009
Location: Greater Columbia Chamber of Commerce
Columbia, SC
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