...

View Full Version : rollover working in FF but not IE



mightypants
06-01-2009, 06:33 PM
Hi, I've got a rollover on a site that is working fine in Firefox, but does nothing in IE. Any help much appreciated. Here's the script:


window.onload = rolloverInit;

function rolloverInit() {
for (var i=0; i<document.images.length; i++) {
if (document.images[i].name == "jsbutton") {
setupRollover(document.images[i]);
}
}
}

function setupRollover(thisImage) {
thisImage.outImage = new Image();
thisImage.outImage.src = thisImage.src;
thisImage.onmouseout = rollOut;

thisImage.overImage = new Image();
thisImage.overImage.src = "images/" + thisImage.id + "_over.gif";
thisImage.onmouseover = rollOver;

}

function rollOut() {
this.src = this.outImage.src;
}

function rollOver() {
this.src = this.overImage.src;
}

and the HTML for the appropriate images:


<li><a href="https://register.pearsoncmg.com/reg/register/reg1.jsp"
target="_blank"><img src="images/reg.gif" width="122" height="25" alt="Register" name="jsbutton" id="reg" class="accessBtn" /></a>
<a href="http://pegasus2.pearsoned.com/" target="_blank"><img src="images/log.gif" width="122" height="25" alt="Login" name="jsbutton" id="log" class="accessBtn" /></a>
<a href="https://register.pearsoncmg.com/buy/buy1.jsp?productID=44782" target="_blank"><img src="images/olp.gif" width="122" height="25" alt="Purchase Access" name="jsbutton" id="olp" class="accessBtn" /></a> </li>

The script is in an external file and is linked appropriately.

Thanks.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum