Jquery fadein和out

0 jquery timing fadeout fadein

看看这个:http://novarose.co.cc/web2/

淡化效果有点混乱,我不知道如何使其正常工作.

我希望代码按以下顺序运行:

  1. 淡出块
  2. 插入新内容
  3. 淡出

我对该页面的jQuery代码:

$('#navigation a').click(function(){$ .get("page.php",{page:$(this).attr('id')},function(data){$('# content').fadeOut('slow').html(data).fadeIn('slow');});});

nic*_*des 7

你的问题在这里:$('#content').fadeOut('slow').html(data).fadeIn('slow'); });fadeInfadeOut完成之前就开始了.你想这样做:

$('#content').fadeOut('slow', function(){
  $(this).html(data).fadeIn('slow')
});
Run Code Online (Sandbox Code Playgroud)

第二个参数是完成fadeOut要调用的函数.fadeOut