PDA

View Full Version : Schedule image



crashcarter
09-25-2008, 05:00 AM
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?

Nile
09-26-2008, 12:25 AM
I see you saw this thread already:
http://www.dynamicdrive.com/forums/showthread.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.

magicyte
09-26-2008, 11:03 PM
It should be working...

-magicyte

crashcarter
11-04-2008, 04:00 AM
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.

Nile
11-04-2008, 04:13 AM
Here:


<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.