Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wait for jQuery show() to finish before continuing function?

I can't make my div visible with the jquery show() until my function is over! It actually works in IE/FF but not in Chrome. How can I make sure my element is visible before continuing with my function?

Here's my code:

function doOperation(){
    $("#progressbar_area").show();
    (...)
}
like image 627
David Avatar asked Jun 23 '09 09:06

David


1 Answers

Add a callback to show:

$("#progressbar_area").show(speed, function() {});

The callback function will be called when the animation is complete.

like image 68
kgiannakakis Avatar answered Nov 09 '22 23:11

kgiannakakis