jqueryで関数の順序を制御しようとしています。画像のようなクリックIDでフェードアウトし、画像のソースを交換してから、新しい画像がフェードインします。
私は次のような作品を持っていますが、一度にすべてを行うだけですが、これを防ぐ方法はありますか?
// Animate height of div containing information
$(this).animate({
'height' : '600px'
},500, function(){
$('html, body').animate({ scrollTop: $(this).offset().top });
// Fade initial image out
img.fadeOut();
// Switch to hi-red image
img.attr('src', function(i, value) {
return '_includes/images/work/hires/' + value;
});
//Fade Hi res image in
img.fadeIn();
});