![]() |
|
|
+ Search |
![]()
|
Feb 12th, 2000 17:37
Martin Honnen,
Use
var now = new Date()
to get the current time and then document.write the IMG element
depening on the current hour:
<SCRIPT>
var dayImage = 'day.gif';
var nightImage = 'night.gif';
var now = new Date();
var hour = now.getHours();
if (hour >= 8 && hour <= 20)
document.write('<IMG SRC="' + dayImage + '">');
else
document.write('<IMG SRC="' + nightImage + '">');
</SCRIPT>