I have something like this:
function doSomething() {
var obj = $('somediv');
...
waitAndDoSomethingElse(obj);
...
$('somediv').show();
...
}
function waitAndDoSomethingElse(obj) {
obj.fadeIn();
....
}
I want doSomething() to pause... execute waitAndDoSomethingElse() and then continue... Any ideas?
Thank you
EDIT:
I'll try to explain better, sorry if my question was confused...
function showSomething() {
var whatToShow = $('#div');
doSomethingElse();
whatToShow.fadeIn('slow');
}
function doSomethingElse() {
$('#someDiv').appendTo($('#someOtherDiv'));
$('#somethingElse').fadeIn('slow');
...
}
In this example whatToShow.fadeIn will fire without waiting for doSomethingElse to end...