Friday, December 30, 2011

Live Clock

Description: An extremely versatile cross browser live clock script. Every aspect of it is configurable, from specifying whether to just display the time, the time plus date, to the clock's font size/color, and more. The ultimate live clock script this is!

Directions:

Step 1: Add the below code where you wish the clock to appear on the page:

<script language="javascript" src="liveclock.js">
/*
Live Clock Script-
By Mark Plachetta (astro@bigpond.net.au©) based on code from DynamicDrive.com
For full source code, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/
</script>

Step 2: Inside the <BODY> tag itself, throw in the following onLoad event handler, as follows:

<body onLoad="show_clock()">

Step 3: Finally, you have a big decision to make. This script requires one of the below two .js files to operate...which one to download depends on how you wish the script to display itself. The first .js file allows you to display not only the time, but date as well, while the later, just the time. There's a 3k size difference between the two files, just so you know:

Download ONE of the following two files, and upload to the directory where your webpage resides (click on file, or click with shift key depressed in NS):


Should you choose the later, make sure to change the reference in the code of Step 1 to correctly reference its name. Furthermore, both files require some editing inside to configure the clock's style, which you can do through any text editor, such as Windows Notepad.

No comments:

Post a Comment