jquery waiting until function is done
- by matthewsteiner
So, I set the closing function for simple modal as follows:
$.modal.defaults.onClose = function (dialog) {
$.validationEngine.closePrompt(".formError",true);
dialog.data.fadeOut('slow', function () {});
dialog.container.fadeOut('slow', function () {});
dialog.overlay.fadeOut('slow', function () {
$.modal.close();
});
}
The line where the validationengine closes prompts basically just makes some divs disappear. The problem is that I don't want things to start fading out until closePrompt() is complete. Is there a way to do that? Is the only way with a "callback"? I don't think it has that built in to the function. Any other way to do it?