我有一个问题,我想淡出图像,然后将图像移动到空< li>容器.但是,图像不会褪色,而是使用html()看起来就像移动覆盖了淡入淡出一样.
以下是我正在尝试做的事情.有没有办法可以强制移动等待淡入淡出完成?
// Fade out image to be replaced
mosaic_Box.find('img').fadeto(7000,0.0)
// Then move the image
$('.mosaic_list li:empty',obj)
.random(1)
.html(mosaic_Box.find('img')
.addClass('mosaic_last_img')
);
解决方法
在fadeto函数的回调中移动:
mosaic_Box.find('img').fadeto(7000,0.0,function() {
$('.mosaic_list li:empty',obj)
.random(1)
.html(mosaic_Box.find('img').addClass('mosaic_last_img'));
});