I have a simple script that checks if a particular file is the background image for a given div befpre swapping the image for a rollover effect. The code I have works perfectly in firefox and IE, but i can’t get it to work in safari or IE:Mac. I was wondering if anyone knew of a work around for this problem.
The working firefox/IE code is as follows:
function hover(button) {
if (document.getElementById(button).style.backgroundImage != "url(/images/buttons/"+button+"_down.gif)") {
document.getElementById(button).style.backgroundImage="url(images/buttons/"+button+"_on.gif)";
}
}
Thanks for your help in advance.