사용하는 첫 번째 대화의 경우
position: {
my: "center middle",
at: "center middle",
of: window
},
올바르게 작동하고 화면 중앙에 배치됩니다. 그런 다음 동일한 코드를 사용하여 그 위에 나타나는 확인 대화 상자가 있으며 my
부품이 제대로 작동하지 않는 것처럼 왼쪽 상단 모서리가 가운데에 맞춰진 것 같습니다 . 둘 이상의 대화 상자가 표시 될 때 수행해야하는 특별한 사항이 있습니까?
코드의 발췌 부분 SetupDialog
은 올바르게 중앙에 배치 된 첫 번째 대화 상자를 openConfirmation
설정합니다. 기능 은 올바르게 작동하지 않는 대화 상자를 설정합니다.
setupDialog: function() {
var self = this;
this.$div.dialog({
modal: true,
width: "auto",
autoResize: true,
resizable: true,
autoOpen: false,
position: {
my: "center middle",
at: "center middle",
of: window
},
title: "Submit Group",
buttons: {
Submit: function() {
var checked = $("input[type=radio][name=calcSelectionRadio]:checked");
if (self.invalidInput(checked)) {
ShowError("You cannot select this row because it contains invalid values");
}
switch (checked.val()) {
case "manual":
var row = [];
$(checked).parents("tr").children("input").each(function(index, input) {
row.push($(input).val());
});
self.openConfirmation(row);
break;
case "lastYear":
self.openConfirmation(self.lastYearArray);
break;
case "calculated":
self.openConfirmation(self.calculatedArray);
break;
default:
ShowError("You must select a row of values to submit");
}
},
Cancel: function() {
$(this).dialog("close");
}
},
open: function() {},
close: function() {}
});
},
openConfirmation: function(classArray) {
var self = this;
var dialogDiv = $("<div id='submitConfirm'></div>").dialog({
modal: true,
title: "Confirmation",
width: "auto",
position: {
my: "center middle",
at: "center middle",
of: window
},
open: function() {
$(this).html(
"This operation will replace all class AADT values <br>for the group named : '" + self.groupName + "' and mark the group as completed<br><br>"
);
},
close: function() {
$(this).dialog("destroy").remove();
},
buttons: {
OK: function() {
Utils.disableDialogInputs(dialogDiv, true);
WebMethod.UpdateAadts(self.groupId, window.currentYear, classArray, function(err, response) {
Utils.disableDialogInputs(dialogDiv, false);
if (err) throw err;
$(this).dialog("close");
self.$div.dialog("close");
});
},
Cancel: function() {
$(this).dialog("close");
}
}
});
},
첫째, middle
허용되는 수직 값이 아닙니다.
가능한 수평 값 :
"left"
,"center"
,"right"
. 가능한 수직 값 :"top"
,"center"
,"bottom"
.
참고 : https://api.jqueryui.com/position/
이제 기본적으로 값은 다음과 같습니다.
position: { my: "center", at: "center", of: window }
더보기 : https://api.jqueryui.com/dialog/#option-position
따라서 기본 위치가 작동합니다. 두 번째 대화 div
의 경우 첫 번째 대화 의 요소를 사용하고 그 중심을 맞출 수 있습니다.
position: {
my: "center",
at: "center",
of: "#setupDialog"
}
HTML이나 실제 예제로 테스트하는 방법을 제공하지 않았기 때문에 다른 어떤 것이 포지셔닝에 영향을 미치는지 확인하거나이 솔루션을 테스트 할 수 없습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다