Click to See Complete Forum and Search --> : time image
stancreator
07-23-2003, 03:13 PM
Hi all, can anyone tell me some javascript code (i think it's javascript) that will display an image depending on the time. for example i can set a time (e.g6pm) and it displays, say, some stars, then at 6am it displays a sun. any help would be greatly apreciated. thanks
Charles
07-23-2003, 03:26 PM
<script type="text/javascript">
<!--
hours = new Date().getHours();
document.write('<img alt="" src="', hours < 6 || hours > 18 ? 'http://www.bettiepage.com./images/photos/whip/whip7.jpg' : 'http://www.bettiepage.com./images/photos/bikini/bikini1.jpg', '">');
// -->
</script>
<noscript><img srg="http://www.bettiepage.com./images/photos/jungle/jungle11.jpg"></noscript>
David Harrison
07-23-2003, 03:27 PM
How's this:
blindrain
07-23-2003, 06:25 PM
try this change the picture file names accordingly
the picture and clock are dynamic they will always change no matter where in the page with out the use of forms.