Results 1 to 4 of 4

Thread: Monthly rotation of images--seeking script

  1. #1
    Join Date
    Jan 2006
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Monthly rotation of images--seeking script

    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

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Ideally, this should be done server-side.
    However...
    Code:
    <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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2006
    Posts
    21
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •