View Full Version : [Javascript] Class-Based Javascript Analog Clock

10-14-2006, 01:01 AM
1) CODE TITLE: Class-Based Javascript Analog Clock

2) AUTHOR NAME/NOTES: Fordiman (via ByteMyCode.com (http://www.bytemycode.com))

3) DESCRIPTION: This is the best Javascript clock implementation on our site. It displays an analog clock using a dynamically created set of divs that can be formatted using a style sheet and is implemented as a well-formed Javascript class.

4) URL TO CODE: http://www.bytemycode.com/snippets/snippet/418/

10-14-2006, 09:54 AM
Javascript doesn't have classes, it uses prototype-based OO :) But nevertheless, a fairly nice script. I must enquire, though: why:
analogClock.prototypes = Array();? Since you don't actually use it as an array, you might as well just use a plain Object; and since you only give it one property, you might as well append position directly to analogClock.

10-14-2006, 10:13 AM
How does it work?