PDA

View Full Version : Monthly rotation of images--seeking script



vrm
05-13-2006, 01:02 AM
Hi Folks,

First, I use the Ultimate Fade-In slide show (and thanks to jscheuer1) it's works beautifully. It is the only script I found that the fade effect is visible on the Mac.

I did a search, but could not find a script that would allow me to rotate images once a month. The image size would be 740x120. The automatic monthly change would mean one less thing to worry about in web site maintenance.

Sincerely,
VRM

Twey
05-13-2006, 08:36 AM
Ideally, this should be done server-side.
However...

<script type="text/javascript">
var imgprefix = "mi",
imgsuffix = ".jpg";

var gatsu = (new Date()).getMonth() + 1;
document.writeln('<img src="' + imgprefix + gatsu + imgsuffix + '" width="740" height="120">');
</script>For example, in this case, it would, every month, rotate:
mi1.jpg // January
mi2.jpg // February
mi3.jpg // March
...

You can also specify images in a different directory, by specifying the relative directory in imgprefix.

vrm
05-13-2006, 12:35 PM
Thank You.

What do you mean by "this should be done server-side"?

If you could give simple instructions, like you did for the script, that would be appreciated. I am open to trying and learning.

Sincerely,
VRM

Twey
05-13-2006, 12:51 PM
If you could give simple instructions, like you did for the script, that would be appreciated. I am open to trying and learning.The method of accomplishing this would depend on the server-side language(s) installed on your server.