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'); });
精彩评论