This question is similar to this one about animation queues, but the answers in that thread are very specific and not easily generalised.
In my web application, messages are reported back to the user (info boxes, errors & warnings, etc) by outputting a div
with class="alert"
eg:
<div class="alert">Login successful</div>
<div class="alert">You have new messages waiting</div>
There could be any number of alerts on a page, depending on what the user does.
What I'd like is to use a jQuery animation to show each of the alert boxes sequentially: once one animation ends, the next one begins.
The answers in that other question said to use a callback like:
$('#Div1').slideDown('fast', function(){
$('#Div2').slideDown('fast');
});
except that won't work if there's an unknown number of divs to animate. Anyone know of a way to achieve this?