Results 1 to 4 of 4

Thread: Image Rotation based on Schedule

  1. #1
    Join Date
    Aug 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Image Rotation based on Schedule

    Hello, I seem to have misplaced my code for running an image based on a schedule. I was wondering if anyone would have something similar?

    It's basically a code that would run a certain image at a certain time eg: img 1 runs at 1pm monday thru friday, img 2 runs at 5pm monday thru friday and img 3 runs at 9am on saturday and sunday...

    If you could possibly lead me in the right direction that would be so helpful!

    Cheers,
    C

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Take a look at this post on codingforums.com:
    http://codingforums.com/showpost.php...4&postcount=14
    Jeremy | jfein.net

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Code:
    <img id="myImage" alt="myImage" title="myImage">
    <script type="text/javascript">
    var date = new Date();
    if ((date.getDay() > 0 && date.getDay() < 6) && date.getHours() == 14) {
      document.getElementById("myImage")["src"] = "MON-FRI-2-OCLOCK-IMAGE.jpg";
    };
    </script>
    - Mike

  4. The Following User Says Thank You to mburt For This Useful Post:

    crashcarter (09-16-2008)

  5. #4
    Join Date
    Aug 2008
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I was trying to get this script to work and can't seem to figure it out. Will I have a separate script for each image? If I was to have 5 different images per day would I have 5 scripts in the same place? ..or can I just add them right before the </script>

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
  •