I have this ajax function:
function callpage() {
$('#formcontent').empty().html('<p class="vent">Pleace wait</p>');
var form = $('form#sog');
$.ajax({
type: form.attr('method'),
url: form.attr('action'),
data: form.serialize(),
success: function(msg) {
$('#formcontent').css("border", "none").html(msg);
}
});
}
When it is called I want to shadow everthing else, then the formcontent div and all other jquery functions should be disabled until the ajax call has succeeded.
Update:
My toggle function that should be disabled when callpage is called until it is succeeded:
$('#search').hover(
function () {
$('#search').animate({width: '400px'}, 500, function() {});
},
function () {
$('#search').animate({width: '200px'}, 500);
callpage();
}
);
You could call an overlay when the AJAX call start with AJAXStart and then hide it with ajaxComplete
Or you can put everything in the call:
EDIT i take the overlay from the other answer
For your function you could add some extra logic and check if the overlay is visible or not