Re: sexy javascript clocks

by "Andrew Tait" <atait(at)netc.net.au>

 Date:  Sun, 25 Jan 1998 15:40:13 +1100
 To:  <hwg-graphics(at)hwg.org>
  todo: View Thread, Original
Here is a script for a clock that I wrote. It works in IE3 and NN3, don't
know about NN2 or IE2, never tried.

< html> <!-- changed for people using Hotmail, just change back to
<html> -->
<head>
<meta name="Author" content="Andrew Tait">
<title>Clock</title>
</head>
<body text="#FFFFFF" bgcolor="#000000" link="#FFFF00" vlink="#FFFF00"
alink="#FFFF00" topmargin="0" leftmargin="0" background="back.gif"
bgproperties="fixed" onload="go()" onunload="stop()">

<form name="display">
      <p><input type="text" size="8" name="display"></p>
      <script language="JavaScript"><!--
var id;
var hour = "";
var minute = "";
var seconds = "";
function stop(){clearTimeout(id);}
function go(){
var Data = new Date();
if(Data.getHours() > 11)
 {hour = Data.getHours() - 12;}
else
 {hour = Data.getHours()}
if(hour == 0)
 {hour = 12;}
if(Data.getMinutes() < 10)
 {minute = '0' + Data.getMinutes();}
else
 {minute = Data.getMinutes();}
if(Data.getSeconds() < 10)
 {seconds = '0' + Data.getSeconds()}
else
 {seconds = Data.getSeconds()}
document.display.display.value = (hour + ':' + minute + ':' + seconds);
id=setTimeout("go()",999);
}
// --></script>
    </form>
</body>
</html>

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA