|
Help with some javascript
|
Ok so my main goal is to display a new random image for my background of 31 images each day of the month, and I want it so that only one image is displayed each day. Here is the script I have:
var odd = Math.floor(Math.random()*31);
var img = new Array();
Stamp = new Date();
today = Stamp.getDate();
then i have my array pointing to the images
document.write(img[Math.abs(today - odd)]);
</script>
</head>
<body>
<table border="0" width="320" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="480">
<tr>
<td>
<p align="center"> </td>
</tr>
</table>
</body>
Please let me know if this is sufficient enough or do I have to respring it for it to take effect each day because thats what i had to do today to change it. THank you for all your help
|
|