开发者

jQuery BlockUI Plugin - How to set a callback function when I need to unlock the BlockUI

I am working on the jQuery BlockUI Plugin and I like to adopt the style illustrated for iPhoto (ish) http:开发者_运维知识库//malsup.com/jquery/block/#demos.

I have designed the jQuery Form that will be submitted through aJax. Here is what I would like to do:

1> After the user clicks the submit button to fire up the form to server, I pop-up such a iPhoto (ish) dialog

2> When the aJax response event returns, then I unlock this dialog.

What should I do to achieve such a feature?

Thank you


You can unblock the UI having it triggered on the .ajaxStop() event, like this:

$(document).ajaxStop(function() {
  $.unblockUI();
});

This would un-block the UI when the last AJAX request completes. If you haven't got the first portion, there's a matching .ajaxStart(), like this:

$(document).ajaxStart(function() {
  $.blockUI({ ...options... });
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜