Javascripts > Javascript Clocks > Visual Clock
Script Title: Visual Clock
Description: This script shows a real-time digital clock using your own images! Download the images from http://clock.uophetnet.com
Example: Available
Copy the following code into your <HEAD></HEAD> tags.<script language="Javascript"> function Go() { /* original by Tim Van Goethem, tim@uophetnet.com */ nu = new Date(); hr = nu.getHours(); min = nu.getMinutes(); sec = nu.getSeconds(); ext = ".gif"; if(hr<="9"){hr = "0" + hr;} else {hr = "" + hr;} if(min<="9"){min = "0" + min;} else {min = "" + min;} if(sec<="9"){sec = "0" + sec;} else {sec = "" + sec;} hrc = hr.substring(0,1); hrd = hr.substring(1,2); document.images.hra.src = "" + hrc + ext; document.images.hrb.src = "" + hrd + ext; minc = min.substring(0,1); mind = min.substring(1,2); document.images.mina.src = "" + minc + ext; document.images.minb.src = "" + mind + ext; secc = sec.substring(0,1); secd = sec.substring(1,2); document.images.seca.src = "" + secc + ext; document.images.secb.src = "" + secd + ext; setTimeout("Go()", 20); } </script>
Copy the following code INTO your <BODY> tag.<body onLoad="Go();">
Copy the following code between the <BODY></BODY> tags of your html page.<img src="" name=hra><img src="" name=hrb><img src="y.gif"><img src="" name=mina><img src="" name=minb><img src="y.gif"><img src="" name=seca><img src="" name=secb>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email