More work on the digital clock code! Arkansas

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

Local Companies

Softwyre
(501) 734-0017
804 Edgewood
Maumelle,, AR
Applied Technology Group
(501) 372-2373
3201 US Highway 161
North Little, AR
Dynamic Programming Inc
(501) 224-9111
11301 Southridge Dr
Little Rock, AR
Strategic Concepts Inc
(479) 271-7400
3202 Moberly Ln
Bentonville, AR
Digital Data Technologies
(870) 763-5512
2926 E State Highway 150
Blytheville, AR
Integris Computer Technology
(479) 927-3303
109 Spring St
Springdale, AR
Netsecure Inc
(501) 664-8401
Little Rock, AR
Hail Technologies Inc
(870) 251-3977
8 Pepsi Cola Rd
Batesville, AR
Butram System Engineering
(501) 562-7104
7301 Mabelvale Pike
Little Rock, AR
Graylint Enterprises Inc
(479) 587-8132
325 S Mashburn Ave
Fayetteville, AR

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

Softwyre

5017340017
804 Edgewood
Maumelle,, AR

Regional Articles
- More work on the digital clock code! Arkadelphia AR
- More work on the digital clock code! Bella Vista AR
- More work on the digital clock code! Benton AR
- More work on the digital clock code! Bentonville AR
- More work on the digital clock code! Blytheville AR
- More work on the digital clock code! Cabot AR
- More work on the digital clock code! Conway AR
- More work on the digital clock code! El Dorado AR
- More work on the digital clock code! Fayetteville AR
- More work on the digital clock code! Forrest City AR
- More work on the digital clock code! Fort Smith AR
- More work on the digital clock code! Harrison AR
- More work on the digital clock code! Hope AR
- More work on the digital clock code! Hot Springs National Park AR
- More work on the digital clock code! Jacksonville AR
- More work on the digital clock code! Jonesboro AR
- More work on the digital clock code! Little Rock AR
- More work on the digital clock code! Mountain Home AR
- More work on the digital clock code! North Little Rock AR
- More work on the digital clock code! Paragould AR
- More work on the digital clock code! Pine Bluff AR
- More work on the digital clock code! Rogers AR
- More work on the digital clock code! Russellville AR
- More work on the digital clock code! Searcy AR
- More work on the digital clock code! Sherwood AR
- More work on the digital clock code! Siloam Springs AR
- More work on the digital clock code! Springdale AR
- More work on the digital clock code! Texarkana AR
- More work on the digital clock code! Van Buren AR
- More work on the digital clock code! West Memphis AR
- More work on the digital clock code! White Hall AR

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