Possible Duplicate:
Javascript callback programming?
A lot of jquery functions allow for a callback. Most are in a syntax like:
$('.selector').slideUp('fast', function(){
alert('slideUp has completed');
});
If I'm writing my own function, how can I make sure it is finished before the one after it is called (i.e. provide a callback parameter)