I'm trying to create an effect where you click on a thumbnail image, and the link to the thumbnail will replace the main image, but fade it in. This is the code I'm currently using:
$(".thumbs a").click(function(e) {
e.preventDefault();
$imgURL = $(this).attr("href");
$(".boat_listing .mainGallery").fadeIn(400, function() {
$(".boat_listing .mainGallery").attr('src',$imgURL);
});
});
This works and replaces the image without a fade effect. What do I need to change to get the fadeIn effect to work?
question from:https://stackoverflow.com/questions/5979418/jquery-change-image-src-with-fade-effect