More work on the digital clock code! Park Hills MO

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

Local Companies

Kelly Mitchell Group
(314) 727-1700
101 S Hanley Rd
Saint Louis, MO
American Technology Corp
(636) 557-7777
174 Clarkson Rd Ste 125
Ballwin, MO
Unidev
(636) 532-4424
1415 Elbridge Payne Rd
Chesterfield, MO
PC Solutions
(417) 682-3194
401 SE 54th Ln
Lamar, MO
Comtrak Technology
(314) 731-7039
5657 Campus Pkwy
Hazelwood, MO
Frosch Enterprises Inc
(636) 498-0635
1405 Jungermann Rd Ste B
Saint Peters, MO
Lowenstein & Associates PC
(816) 632-2263
309 N Main St
Cameron, MO
Computers & Things Inc
(636) 661-5508
112 1st St
Old Monroe, MO
E-Com Solutions Llc
(636) 532-5320
1350 Elbridge Payne Rd
Chesterfield, MO
Itek
(816) 358-4835
6012 Arlington Ave
Raytown, MO

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

JW Software, Inc

800-828-6120
12300 Old Tesson Rd, Suite 400B
St Louis, MO
http://www.jwsoftware.com

JW Software, Inc., (JWS) is a software development firm focused on the development and support of product-based <a href='http://www.jwsoftware.com/'>insurance software solutions</a>, specifically <a href='http://www.jwsoftware.com/filehandler.asp'>FileHandler</a>® and <a href='http://www.jwsoftware.com/policyhandler.asp'>PolicyHandler</a>®. Both systems are fully integrated and provide the client a modularized, multi-line, end-to-end, .NET, browser-based <a href='http://www.jwsoftware.com'>Policy Management System</a> and <a href='http://www.jwsoftware.com'>Claims Administration System</a> designed to support Carrier, MGA, TPA, Risk Pool, Self Insured, and Municipality insurance operations. In business for over 21 years , JWS has maintained and continues to leverage our mission statement as its benchmark for service and quality: “Provide clients a strategic combination of cutting-edge technology and unparalleled services to streamline operations, producing positive results in increased production and lower costs”. Schedule an online Web Demo at www.jwsoftware.com/info.asp or to find out more, please call 800-828-6120 or visit us at www.jwsoftware.com.


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