简体   繁体   中英

Image does not appear properly

I have added custom code in suffusion-subscription.php to change the image of a Facebook icon when the mouse is hovering on the image.

During initial load, no image shows up. After that mouseHover and mouseOut event shows appropriate images but not on initial load.

The following image shows the issue:

在此输入图像描述

JavaScript:

//preload images:
fb1 = new Image(64,64);
fb1.src = "http://sohamshah.com/wordpress/wp-content/themes/suffusion/images/follow/Facebook-04.png";
fb2 = new Image(64,64);
fb2.src = "http://sohamshah.com/wordpress/wp-content/uploads/2011/11/fb-broken.png";

//image swapping function:
function hiLite(imgDocID, imgObjName, comment) {

document.images[imgDocID].src = eval(imgObjName + ".src");
window.status = comment; return true;
}

</script>

HTML:

<div class='fix'>
    <a href="http://feeds.feedburner.com/sohamshah" class="follow-icon-and-tag" title="RSS">
        <img src="http://sohamshah.com/wordpress/wp-content/themes/suffusion/images/follow/RSS-13.png" alt="RSS" style='width: 64px; height: 64px;' />
    </a>
    <a href="http://www.facebook.com/soham100" onMouseOver="hiLite('fb','fb2','Follow Me on FaceBook')"  onMouseOut="hiLite('fb','fb1','')" class="follow-icon-and-tag" title="Facebook">
        <img name="fb" "src="http://sohamshah.com/wordpress/wp-content/themes/suffusion/images/follow/Facebook-04.png" alt="Facebook" style='width: 64px; height: 64px;' />
    </a>

  <a href="http://twitter.com/sohamshah" class="follow-icon-and-tag" title="Twitter">
            <img src="http://sohamshah.com/wordpress/wp-content/themes/suffusion/images/follow/Twitter-08.png" alt="RSS" style='width: 64px; height: 64px;' />
        </a>

   </div>

Any help in this matter will be appreciated.

Soham

图片标记中的src旁边有一个额外的双引号。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM