HTML :
<img class=change src="http://{{$image_server}}/web/product/medium/{{$prod_info.image_medium}}" style='width:380px;' />
JQUERY :
var images = [ "01.jpg", "02.jpg", "03.jpg" ];
$(function() {
index = 0;
$('.change').click(function(e) {
var image = images[index++];
if(index == images.length)
index = 0;
$('.change').parent().fadeOut(200, function() {
$('.change').attr('src', ''+image);
$(this).fadeIn(200);
});
});
});
I used this code for image fade in/out on click. But, new image didn't fade in on my system. An old image faded out/in and suddenly appear a new image! I wanna know how to fade in new image smoothly.