$(function() {
$(".flexslider img")
.mouseover(function() {
var src = $(this).attr("src").match(/[^\.]+/) + "-bw.png";
$(this).attr("src", src);
})
.mouseout(function() {
var src = $(this).attr("src").replace("-bw.png", ".png");
$(this).attr("src", src);
});
});
I have a carousel that appears on most pages of a wordpress theme, I need to change any image in any carousel to a new attr when mouseover which is the old src + -bw or any suffix. But this needs to tween or animate. The above code changes the image but doesnt animate. Also many people suggest pre loading the image that are to be revealed on hover?