I was wondering if it was possible to add a fadeIn effect when an attr is changed for example I have this code working, when the user clicks on img2 imgmain’s src is changed to img2’s like this:
$('#img1').click(function() {
$("#imgmain").attr("src","img1.jpg");
});
$('#img2').click(function() {
$("#imgmain").attr("src","img2.jpg"); }
);
Thank you!
You can change it on the
fadeOut()callback, like this: