Analogue clock


Skip navigation.

Site search

Site navigation

Details and download

Analogue clock

This seemingly simple clock actually requires a lot of programming to achieve. It serves no real purpose as almost all users have a clock on their screen anyway, but it serves a good tutorial purpose.

To download the script(s), see the script license, and check details like browser compatibility, use the links on the navigation panel at the top of this page.

Every 75ms, the browser window settings are taken, including height and width and scrolling amount. The offset of the clock from the top corner of the page is calculated according to user preference. The positions of the numbers and parts of the hands are calculated using some complicated sine and cosine functions.

The following aspects of the clock are configurable:

This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.