开发者

Fade out before loading new content

How do I fade out #special, then load the content, and when it´s loaded fade in again.

function test(x,y) {
    $('#special').fadeOut('fast').fadeIn('slow');
    $('#special').load('index.php?close=1 #special');     
}

I don´t want it to display/load the new co开发者_StackOverflowntent until #special has faded out.


You need to call fadeIn() inside the load() callback, which runs after it's loaded:

$('#special').fadeOut('fast');
$('#special').load('index.php?close=1 #special', 
                   function() { $('#special').fadeIn('slow'); });     
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜