I'm including the Javascript (jQuery really) in order to change the img src in question from one image to another image on hover.
However this isn't working - the images don't change at all.
My only guess is that the unnamed functions aren't doing what I want them to do.
My knowledge of jQuery is still somewhat new, so I'm stumped here and can't find any resources on what I might be doing wrong.
jQuery("#fbicon").hover(
function () {
jQuery(this).attr("src","images/nohoverfb.png");
},
function () {
jQuery(this).attr("src","images/fb.png");
});
jQuery("#linkedinicon").hover(
function () {
jQuery(this).attr("src","images/nohoverlinkedin.png");
},
function () {
jQuery(this).attr("src","images/linkedin.png");
});
jQuery("#googleplusicon").hover(
function () {
jQuery(this).attr("src","images/nohovergoogle+.png");
},
function () {
jQuery(this).attr("src","images/google+.png");
});
jQuery("#youtubeicon").hover(
function () {
jQuery(this).attr("src","images/nohoveryoutube.png");
},
function () {
jQuery(this).attr("src","images/youtube.png");
});
jQuery("#twittericon").hover(
function () {
jQuery(this).attr("src","images/nohovertwitter.png");
},
function () {
jQuery(this).attr("src","images/twitter.png");
});
jQuery("#emailicon").hover(
function () {
jQuery(this).attr("src","images/nohoveremail.png");
},
function () {
jQuery(this).attr("src","images/email.png");
});
Here is an example of the HTML:
<span class="icon"><a target="_blank" href="http://www.facebook.com/facebookname"><img id="fbicon" src="http://www.website.com/sites/all/themes/website/images/fb.png" style="height:48px;width:48px"></a></span>