アラート、確認、ダイアログ機能に qtip2 を使用しています。今、私は(blockuiプラグイン)いくつかのプロセスが完了するまでページのビューをブロックしたい(e. ajax startなど)。そのために、次のコードを使用しています
function blockPageDialog(content, title) {
/*
* mainbody is the id of the body section of html
*/
$('#mainbody').qtip(
{
content: {
text: '<img src="/Content/images/ajax-loader.gif"/>'
},
position: {
my: 'center', at: 'center', // Center it...
target: $(window) // ... in the window
},
show: {
ready: true, // Show it straight away
modal: {
on: true, // Make it modal (darken the rest of the page)...
blur: false, // ... but don't close the tooltip when clicked
escape: false //dont hide on escape button
}
},
hide: true, // We'll hide it maunally
style: {
classes: 'qtip-shadow qtip-rounded qtip-dialogue', // Optional shadow...
widget: true //themeroller
},
events: {
// Hide the tooltip when any buttons in the dialogue are clicked
render: function (event, api) {
// $('button', api.elements.content).click(api.hide);
}
// Destroy the tooltip once it's hidden as we no longer need it!
, hide: function (event, api) { api.destroy(); }
}
});
}
上記の関数を次のように呼び出しています
blockPageDialog(imageToShowProcessing );
期待どおりにページをブロックしています。
ここで、プロセスの完了時 (つまり、ajax の完了時) またはダイアログの一部ではないボタンのクリック時に作成されたブロッキング ダイアログを非表示/破棄したいと考えています (そのため、ダイアログ内のボタンのコードにコメントを付けました)。
私は次のことを試しました
$('#mainbody').qtip('hide');
$('#mainbody').qtip('api').hide();
どちらも機能していません。
$.browser
エラーを解決するjquery 1.9.1、qtip2アップデート(2.1)を使用しています
問題を解決するために私を導いてください