5
我试图使用jQuery UI做全屏对话框。jQuery ui全屏对话框
我通过AJAX加载的一些内容,并将结果填入对话框:
function openResource(id) {
$.ajax({
url : "",
type : 'post',
dataType : 'html',
data : {
idRes: id
},
success : function(response) {
$("#popupRecurso")
.html("<div style='float:right; cursor: pointer;' onclick='$(\"#popupRecurso\").dialog(\"destroy\");'>fechar</div>" + response);
$("#popupRecurso").dialog({
title : '',
bgiframe : true,
position : 'center',
draggable : false,
resizable : false,
dialogClass : 'dialogRecurso',
width : $(window).width(),
height : $(window).height(),
stack : true,
zIndex : 99999,
autoOpen : true,
modal : true,
open : function() {
$(".ui-dialog-titlebar").hide();
},
error : function(err) {
alert(err);
}
});
}
});
}
不幸的是,该对话框不会出现在中心和不正确的尺寸。 有没有人有过同样的问题?
感谢
我认为float属性可以与位置冲突,在这里。你能删除它吗?如果没有更完整的示例(html + css,请试试jsFiddle),我无法帮到你。 – BiAiB
@BiAiB,即使没有任何HTML,问题仍然存在... – jose
'dialogRecurso'类中的任何CSS? – DarthJDG