Welcome to WebmasterWorld Guest from 54.196.244.186

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Image is not appearing on initial load

     
8:59 pm on Aug 28, 2012 (gmt 0)

New User

joined:June 26, 2012
posts:6
votes: 0


Hello,

I have added custom code in suffusion-subscription.php to change the image of Facebook icon when 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.

Following Image shows the issue:
[sohamshah.com ]

Code that I have added looks like this:

<script language="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>

<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
9:12 pm on Aug 28, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 6, 2006
posts:97
votes: 0


<img name="fb" "src="http://sohamshah.com/wordpress/wp-content/themes/suffusion/images/follow/Facebook-04.png" alt="Facebook" style='width: 64px; height: 64px;' />


Remove the " before the src attribute.
<img name="fb" src="http://sohamshah.com/wordpress/wp-content/themes/suffusion/images/follow/Facebook-04.png" alt="Facebook" style='width: 64px; height: 64px;' />


Hope that helps :)
9:15 pm on Aug 28, 2012 (gmt 0)

New User

joined:June 26, 2012
posts:6
votes: 0


Ahhhh , I did not see that. That was a very stupid mistake.

Yes, it perfectly works now. Thanks a lot for the help.
9:16 pm on Aug 28, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 6, 2006
posts:97
votes: 0


No prob. Sometimes we coders need an extra pair of eyes. 0_0
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members