I use jQuery to block ui like this
$('#send').click(function() {
$.blockUI({ message:
'<p id="loading"><img src="images/busy.gif" /> processing...</p>'});
send();
$(document).ajaxStop($.unblockUI);
setTimeout($.unblockUI, 2000);
});
send()
does some background processing and sets a response message in #loading tag. After the process is finished I want this message to stay for some seconds so I use the setTimeout but this does not work.
Any ideas?
Your script seems to call the unblockUI
using ajaxStop
already? Have you tried to remove this line or set your timeout within the ajaxStop
handler?
UPDATE
You could try this:
$('#send').click(function() {
$.blockUI({ message: '<p id="loading"><img src="images/busy.gif" /> processing...</p>'});
send();
$(document).ajaxStop(function(){
setTimeout($.unblockUI, 2000);
});
});