Reputation: 17352
With the code above I want to slide each container with a constant speed (not duration). Now I want to do something else after ALL container are open. How do I do that? Right now I would do something else after the first slide has been finished. That's not what I'm needing.
var constant = 4;
$('.box > .content').each(function() {
$(this).show();
var boxheight = $(this).height();
$(this).hide();
$(this).slideDown(boxheigt * constant, function() {
// Do something
});
});
Upvotes: 1
Views: 102
Reputation: 3288
How about something like this?
var constant = 4, count = 0;
$('.box > .content').each(function() {
count++;
$(this).show();
var boxheight = $(this).height();
$(this).hide();
$(this).slideDown(boxheigt * constant, function() {
count--;
if(count == 0)
// Do something
});
});
Upvotes: 1