Reputation: 2584
There are 3 divs with a button that makes current div fade out.
How to slideUp the next div bellow after current div is faded out?
$(".btn-disapear").click(function() {
$(this).closest(".panel").fadeOut(400);
$(".this-message").delay( 400 ).fadeIn(400).delay(900).fadeOut(400);
$(this).parent().next(".panel").slideUp(2000);
});
Upvotes: 1
Views: 67
Reputation: 1313
You should use the
.fadeOut( "slow", function() {
//slide up in here
};
Hope this helps
For completeness
$(".btn-disapear").click(function() {
$(this).closest(".panel").fadeOut(400, function(){
$(".this-message").fadeIn(400).delay(900).fadeOut(400, function(){
$(this).parent().next(".panel").slideUp(2000);
});
});
});
Truez
Upvotes: 3
Reputation: 5849
Use .animate()
and .slideUp()
callback functions:
$(".btn-disapear").click(function() {
$(this).closest(".panel").animate({opacity: 0}, 500).slideUp(2000, function() {
$(".this-message").fadeIn(400, function() {
$(this).delay(900).fadeOut(400);
});
});
});
Upvotes: 1