It amounts to this: $.ajaxStart(function () { $('.modal').delay(500).fadeIn(); });
jQuery will wait for half a second before doing the fade in. In the $.ajaxStop you may need to do stop() to prevent the delayed fadeIn from firing if the request finishes within the delay.

Unfortunately, the delay() cannot be cancelled. So maybe the most robust solution would be to use JavaScript's own setTimeout, which can be cancelled by calling clearTimeout.