开发者

Fade out before loading new content

开发者 https://www.devze.com 2023-03-16 07:07 出处:网络
How do I fade out #special, then load the content, and when it´s loaded fade in again. function test(x,y) {

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

精彩评论

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