Hi I'm trying to get my program to switch images with the mouse roll over effect. Basically if it is wednesday i want the image of the calendar to lightup (i have a separate image for that) and if its not wednesday the image changes
Any suggestions?
![]() | It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!) |

|
|
|
|
<script type="text/javascript">
/**
Script Title: Show image by Date
Script Author: Raymond Angana as first seen on devppl.com/forum [username = rangana]
Date Created: 3/4/09
This notice must stay intact for legal use
*/
var ray = {
imgIfNotMatch: 'images/notWednesday.jpg', // URL of image if it is not wednesday
imgIfMatch: 'images/Wednesday.jpg', // URL of image if it is wednesday
showImgByDate:function (el,d) {
var date = new Date();
this.getID(el).src = date.getDay()==d?this.imgIfMatch:this.imgIfNotMatch;
},
getID:function (el) {
return document.getElementById(el);
}
}
</script>
<img src="default.jpg" alt="something better than this text" id="myimage">
<script type="text/javascript">
ray.showImgByDate('myimage',3); // Pass the ID of the image and the date that you want to compare. 0 - Sunday, 1-monday, etc...
</script>

Users browsing this forum: No registered users and 6 guests