Welcome to WebmasterWorld Guest from 54.146.246.4

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Image is not appearing on initial load

     

sotu

8:59 pm on Aug 28, 2012 (gmt 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

cffrost2

9:12 pm on Aug 28, 2012 (gmt 0)

5+ Year Member



<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 :)

sotu

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



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

Yes, it perfectly works now. Thanks a lot for the help.

cffrost2

9:16 pm on Aug 28, 2012 (gmt 0)

5+ Year Member



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