More work on the digital clock code! Wisconsin

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

Local Companies

Practice Management Solutions Inc
414-352-8160
7571 N Teutonia Ave
Milwaukee, WI
codeeo
608 305 1060
1360 Regent Street #155
Madison, WI
Gates Business Solutions
608-661-0810
2810 CrossRoads DR
Madison, WI
Madison Software Inc
608-833-5410
6666 Odana Rd
Madison, WI
Electroniclaim
262-240-9700
11357 N. Port Washington Rd
Mequon, WI
KMSpecialties
414-751-4009
7434-3 Halverson Rd
Three Lakes, WI
Image Processing Software Inc
608-233-5033
6409 Appalachian Way
Madison, WI
Gbl Software LLC
414-760-9029
6417 W Hustis St
Milwaukee, WI
Access Technologies International
414-289-3121
840 N Old World 3rd St
Milwaukee, WI
Guild Software Inc
414-259-0959
10437 W Innovation DR
Milwaukee, WI

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

Practice Management Solutions Inc

414-352-8160
7571 N Teutonia Ave
Milwaukee, WI

Regional Articles
- More work on the digital clock code! Appleton WI
- More work on the digital clock code! Baraboo WI
- More work on the digital clock code! Beaver Dam WI
- More work on the digital clock code! Beloit WI
- More work on the digital clock code! Brookfield WI
- More work on the digital clock code! Burlington WI
- More work on the digital clock code! Cedarburg WI
- More work on the digital clock code! Chippewa Falls WI
- More work on the digital clock code! Cudahy WI
- More work on the digital clock code! De Pere WI
- More work on the digital clock code! Delavan WI
- More work on the digital clock code! Eau Claire WI
- More work on the digital clock code! Elkhorn WI
- More work on the digital clock code! Fond Du Lac WI
- More work on the digital clock code! Fort Atkinson WI
- More work on the digital clock code! Franklin WI
- More work on the digital clock code! Green Bay WI
- More work on the digital clock code! Hartland WI
- More work on the digital clock code! Janesville WI
- More work on the digital clock code! Kaukauna WI
- More work on the digital clock code! Kenosha WI
- More work on the digital clock code! La Crosse WI
- More work on the digital clock code! Lake Geneva WI
- More work on the digital clock code! Madison WI
- More work on the digital clock code! Manitowoc WI
- More work on the digital clock code! Marinette WI
- More work on the digital clock code! Marshfield WI
- More work on the digital clock code! Menasha WI
- More work on the digital clock code! Menomonee Falls WI
- More work on the digital clock code! Menomonie WI
- More work on the digital clock code! Merrill WI
- More work on the digital clock code! Middleton WI
- More work on the digital clock code! Milwaukee WI
- More work on the digital clock code! Mosinee WI
- More work on the digital clock code! Mukwonago WI
- More work on the digital clock code! Muskego WI
- More work on the digital clock code! Neenah WI
- More work on the digital clock code! New Berlin WI
- More work on the digital clock code! Oak Creek WI
- More work on the digital clock code! Oconomowoc WI
- More work on the digital clock code! Onalaska WI
- More work on the digital clock code! Oshkosh WI
- More work on the digital clock code! Pewaukee WI
- More work on the digital clock code! Racine WI
- More work on the digital clock code! Rhinelander WI
- More work on the digital clock code! Rice Lake WI
- More work on the digital clock code! River Falls WI
- More work on the digital clock code! Schofield WI
- More work on the digital clock code! Shawano WI
- More work on the digital clock code! Sheboygan WI
- More work on the digital clock code! South Milwaukee WI
- More work on the digital clock code! Stevens Point WI
- More work on the digital clock code! Sturgeon Bay WI
- More work on the digital clock code! Sun Prairie WI
- More work on the digital clock code! Superior WI
- More work on the digital clock code! Thiensville WI
- More work on the digital clock code! Two Rivers WI
- More work on the digital clock code! Watertown WI
- More work on the digital clock code! Waukesha WI
- More work on the digital clock code! Waupaca WI
- More work on the digital clock code! Wausau WI
- More work on the digital clock code! West Bend WI
- More work on the digital clock code! Whitewater WI
- More work on the digital clock code! Wisconsin Rapids WI

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