0
我有一个jQuery UI对话框,当有表单错误时显示。jQuery UI对话框中动态内容没有居中正确
继承人的代码:
function alert_field_errors (errors)
{
$('<div></div>').dialog({
modal: true,
title: "Error",
open: function() {
$(this).html('The following are required:<br /><br />'+errors+'<br />Please complete these in order to continue.');
},
buttons: {
Ok: function() {
$(this).dialog("close");
}
}
});
}
的errors
变量将包含类似First Name<br />Last Name<br />Email Address<br />
它的伟大工程,除了一个事实,即它不居中。它似乎在加载内容之前定位自己,以便在显示时,对话框的底部边距与对话框的顶部边距相比更靠近窗口的底部。
我试过使用position
选项,但似乎没有任何工作。
任何帮助将不胜感激。