Hi all
I'm having a problem with a series of social buttons, and their rollover event. I have 6 images, with class 'social32' which I'd like to change from their 'off' status to their coloured one. All files are named like 'facebook_32.png' & 'facebook_32_off.png'
$(".social32").each(function(){
var t=$(this);
var src1= $(this).attr("src");
var newSrc = src1.substring(src1.lastIndexOf("/"), src1.lastIndexOf("_off."));
$(this).hover(function(){
$(this).attr("src", "imgs/"+newSrc+"." + /[^.]+$/.exec(src1));
}, function(){
$(this).attr("src", "imgs/"+newSrc+"_off." + /[^.]+$/.exec(src1));
});
});
And the HTML code can't be easier.
<p class="bottom10">
<img class="social32" src="imgs/facebook_32_off.png" width="32" height="32" alt="Facebook" id="Facebook" />
<img class="social32" src="imgs/twitter_32_off.png" width="32" height="32" alt="Twitter" id="Twitter" />
<img class="social32" src="imgs/linkedin_32_off.png" width="32" height="32" alt="LinkedIn" id="Linkedin" />
<img class="social32" src="imgs/skype_32_off.png" width="32" height="32" alt="Skype" id="Skype" />
<img class="social32" src="imgs/googletalk_32_off.png" width="32" height="32" alt="Google Talk" id="GTalk" />
<img class="social32" src="imgs/googlewave_32_off.png" width="32" height="32" alt="Google Wave" id="GWave" />
</p>
For any reason, this works perfectly on IExplorer 8, but doesn't on Firefox, Safari nor Chrome ..
Thanx for your input beforehand!