jQueryUI 模态对话框上的 blockui [英] blockui over jQueryUI modal dialog
本文介绍了jQueryUI 模态对话框上的 blockui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法让 BlockUI 在模态对话框上工作.
我试图处理 z-index 问题,但没有成功...
I can't make BlockUI work over a modal dialog.
I tried to look after z-index issues, but without success...
在我的网页中,这是头部:
In my web page, here is the head :
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js" ></script>
<script type="text/javascript" src="http://jquery.malsup.com/block/jquery.blockUI.js?v2.38" ></script>
<link media="all" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css" rel="stylesheet" />
和身体:
<div id="dialog_test" title="Test">
TEST
</div>
<a href="#" id="go">GO</a>
<script>
$(function() {
$( "#dialog_test" ).dialog({
autoOpen: false,
modal: true,
buttons: {
"Cancel": function() {
$( this ).dialog( "close" );
},
"Ajax": function() {
$.ajax({
"url" : "http://jquery.malsup.com/block/wait.php",
"success" : function(json) {
$( "#dialog_test" ).dialog( "close" );
}
});
}
}
});
$( "#go" ).click(function(event) {
event.preventDefault();
$( "#dialog_test" ).dialog( "open" );
});
});
$(document)
.ajaxStart(function() {
$.blockUI({
theme: true
})
})
.ajaxStop($.unblockUI);
</script>
有什么想法吗?
推荐答案
你没有指定你用 z-index 尝试了什么.
You don't specify what you have tried with z-index.
blockUI 插件有一个选项可以更改它创建的消息的 z-index(文档):
The blockUI plugin has an option to change the z-index of the message it creates (documentation):
// z-index for the blocking overlay
baseZ: 1000,
jQuery UI 对话框作为 用于指定 z-index 的选项.它的默认值是 1000.所以你必须为 BlockUI 选项设置一个更大的数字,比如 2000:
jQuery UI Dialog as an option for specifying a z-index as well. Its default value is 1000. So you have to set a higher number for the BlockUI option, let's say 2000:
$.blockUI({
theme: true,
baseZ: 2000
})
这篇关于jQueryUI 模态对话框上的 blockui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文