Ich benutze Schaltflächen, auf denen ich Bilder gegeben habe. Ich möchte das Bild bei mouseover mit Javascript ändern. Mein Code arbeitet an Chrome, aber es funktioniert nicht für Firefox. Bitte helfen Sie.onmouseover Ereignis funktioniert nicht für firefox
Hier ist der Code ist
Javascript
function rolloverInit() {
for (var i=0; i<document.images.length; i++) {
if (document.images[i].parentNode.tagName == "BUTTON") {
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.alt + "1.png";
thisImage.onmouseover = rollOver;
thisImage.parentNode.childImg = thisImage;
thisImage.parentNode.onblur = rollOutChild;
thisImage.parentNode.onfocus = rollOverChild;
}
function rollOut() {
this.src = this.outImage.src;
}
function rollOver() {
if(prevFlag == 0 && this.id==previous1)
{
return;
}
if(nextFlag == 0 && this.id==next1)
return;
this.src = this.overImage.src;
}
HTML
<button id="prevLinkSimplyP" class="previous"><img src="images/previous.png" height="50" width="50" id="previousSimplyP" alt="previous"/></button>
<button id="startAgainSimplyP" class="reload"><img src="images/reload.png" height="50" width="50" id="reloadSimplyP" alt="reload" /></button>
<button id="nextLinkSimplyP" class="next" ><img src="images/next.png" height="50" width="50" id="nextSimplyP" alt="next"/></button>
Ich kann nicht sehen, ist das Mouseover-Ereignis im Code definiert – UVM