More work on the digital clock code! East Elmhurst NY

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

Local Companies

PNMsoft
(646) 290-5063
845 Third Avenue
New York, NY
huangjie
(010) 564-2835
The northern&shel building eighth floor 10 lower street london
NewYork, NY
IML
1 877 646 2455
211 North End Ave apt 25A
New York, NY
A-1 technology Inc
212-397-7481
115 broadway
New York, NY
Mecca Computer Technologies Corp
(201) 659-5611
580 Luis Munoz Marin Blvd
Jersey City, NJ
Product Identification & Processing Systems, Inc.
(212) 996-6000
436 East 87th Street
New York, NY
DVD Copy Software
contact via email
DVD Copy Software
New York, NY
XLSTAT
(646) 399 0974
28 West 27th Street, Suite 503
New York, NY
A1-Technology
(212) 397-7481
115 Broadway, Suite 1304, NY 10006
NY, NY
Blue Star Infotech America
(201) 420-1800
111 Town Square Pl Ste 600
Jersey City, NJ

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

Product Identification & Processing Systems, Inc.

(212) 996-6000
436 East 87th Street
New York, NY
http://www.pips.com/

Designs, sells & supports its customers in using bar code printing, verification, sacnning & data capture solutions based on the best on-demand tag & label printers & supplies, quality assurance verifiers, scanners & data collection terminals.

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