More work on the digital clock code! Central Islip NY

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

Local Companies

Infotech Concepts Inc
(631) 232-3800
11 Oval Dr Ste 152
Central Islip, NY
Reboot Computer Services Inc
(718) 897-7727
7011 Austin St
Forest Hills, NY
Sam Asher Computing Services Inc
(585) 586-0020
3300 Monroe Ave Ste 317
Rochester, NY
T G Officetex
(585) 345-0335
Batavia, NY
Brainstorm-Micro
(518) 433-1250
11 Pruyn St
Albany, NY
autofunds.com
(888) 903-8637
775 Park Avenue
Huntington, NY
A Plus Computer Service
(631) 630-0285
Central Islip, NY
Amet Computers Inc
(718) 356-4474
80 Kennington St
Staten Island, NY
Global Transcription Inc
(516) 364-8847
100 Lafayette Dr
Syosset, NY
USA Data Inc
(212) 326-8760
10 E 53rd St
New York, NY

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

autofunds.com

8889038637
775 Park Avenue
Huntington, NY
http://www.autofunds.com

Online car dealer software. 3 bureau credit reports, Free OFAC, forms printing, free upload to paid and complimentary inventory classifieds, online vehicle registration, online documents storage.

Professionally designed dealer websites that require zero maintenenance. Free leads and leads management.

Related Local Events
Biotechnica America
Dates: 4/20/2010 - 4/22/2010
Location: Jacob K. Javits Convention Center
New York, NY
View Details

TradeTech USA
Dates: 3/1/2010 - 3/3/2010
Location: Marriott Marquis New York
New York, NY
View Details

BIO CEO & INVESTOR CONFERENCE 2010
Dates: 2/8/2010 - 2/8/2010
Location: Waldorf-Astoria
New York, NY
View Details

I.T. Committee Meeting
Dates: 12/17/2009 - 12/17/2009
Location: Queens Chamber Board Room
Jackson Heights, NY
View Details

I.T. Committee Meeting
Dates: 11/19/2009 - 11/19/2009
Location: Queens Chamber Board Room
Jackson Heights, NY
View Details

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