Hi, befor i start you should know that i have little knowledge of javascript…?
i found this and it works fine, but can some please help as i want to add a 3rd image! i have tried a few things but failed. any help would be great!!!!
/* This script and many more are available free online at
The JavaScript Source!! [url]http://javascript.internet.com
Created by: Anonymous | [url]http://musikimiz.googlepages.comLicensed
function pixTimeChange() {
var t=new Date();
var h = t.getHours();
var r1=”pic1.gif”;
var r2=”pic2.gif”;
var el=document.getElementById(‘myimage’);
// See the time below. Note: The time is in 24 hour format.
// In the example here, “7” = 7 AM; “17” =5PM.
el.src = (h>=7 && h<17) ? r1 : r2;
}
// Multiple onload function created by: Simon Willison
// [url]http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != ‘function’) {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(function() {
pixTimeChange();
});