Results 1 to 5 of 5

Thread: Schedule image

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

    Exclamation Schedule image

    Hey, I managed to get a quick code for my scheduled image but am having some problems configuring it.

    Here's the 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>



    My problem is I need this code to keep a particular image up from mid to 6a then 6a to 9a and 9a to noon during the weekdays then some different schedules on Saturday and Sunday. I can't seem to configure it properly.

    Anyone with any ideas?

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

    Default

    I see you saw this thread already:
    http://www.dynamicdrive.com/forums/s...ad.php?t=35072
    Try in that thread, clicking on the link I posted, but don't use the code I posted in the link I posted, use someone else's.
    Jeremy | jfein.net

  3. #3
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    It should be working...

    -magicyte

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

    Default

    quick question... how can I add a text component that's linked to an email to each image? Eg the 2 - 6pm image has a link to a certain email while the others link to another email.

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

    Default

    Here:
    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";
    document.getElementById("myImage").innerHTML = "Email me: email@dom.com";
    };
    </script>
    Edit the highlighted.
    Jeremy | jfein.net

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
  •