homepage Welcome to WebmasterWorld Guest from 23.22.29.137
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Image is not appearing on initial load
sotu




msg:4489265
 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




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

sotu




msg:4489270
 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




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved