1
我正在使用qtip2提醒,确认,对话功能。现在我想作为(blockui插件)阻止页面的视图,直到某个过程完成(例如ajax start等)。对于我使用下面的代码qtip2模式对话框不隐藏
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();
两者都不能正常工作。
我使用jQuery 1.9.1,它解决了$.browser
错误
qtip2更新(2.1)请指引我解决问题
谢谢!!!!!它只是工作!修改为$('#mainbody')。qtip('destroy');虽然.. – amol 2013-03-22 06:38:00
更正您的建议:) – NoodleFolk 2013-03-22 06:40:24