jQuery - correct way to wait for fade to finish

neo_fmu

New Member
I have a problem where I want to fade out an image, then move the image to an empty \[code\]<li>\[/code\] container. However, the image doesn't fade, instead it just seems like the fade is being overridden by the move, using \[code\]html()\[/code\]. Below is what I'm trying to do. Is there a way I can force the move to wait for the fade to complete? \[code\]// Fade out image to be replacedmosaic_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') );\[/code\]
 
Top