php - why does my image roll over behave this way? -
Roll my image at work ... but there is only one way.
Function Heartwork (ID) {if (document.getElementById ('heart' + ID) .src == 'images / heart line'); {Parent.document.getElementById ('heart' + id) .src = 'image / unknown' '; } If (document.getElementById ('heart' + id) .src == 'image / unknown'); {Parent.document.getElementById ('heart' + id) .src = 'picture / heart'; '; }} & Lt; Img src = "images / heart.png" id = "heart". $ Line ['id']. "Alt =" love! Width = "16" height = "16" range = "0" onmouseover = "heartover '." ('$ Line [id]') ". '; Return back," On-Houseout = "Heartwort" (' $ line [ID] ') ". '; If I do any other work on the IF statement, but they do not work together ... Attention: Try it with:
One else If
is not destiny.
figure it out ... duh: if i have (); No; After that ...
Put someone else between them - otherwise when the first time the correct form , The reason for this will be evaluated as correct as the other!
Here is a simplified example that checks the notion that the IMG element is also present:
var img = document.getElementById ('heart' + id); If (IMG) {if (img src == 'picture / heart-pallet') {img.src = 'images / unheart.png';} and if (IMG src == 'picture / uncheck' '') {Img.src = 'Images / heart.png';}} Other {Warning ("OUooh! No, heart" + ID + "element found!");}
Comments
Post a Comment