1
여러 개의 대화 상자를 차례로 열려고합니다 (첫 번째 대화 상자가 열리고 Ajax 요청이 성공한 경우 두 번째 대화 상자가 표시됩니다). 첫 번째 대화 상자가 올바르게 열립니다. 화면의 중앙에 있지만 닫을 때 두 번째 대화 상자가 중앙의 페이지 상단에 열리지 않습니다.jquery 대화 상자 체인하기 : 두 번째 대화 상자가 중앙에 없음
빌드 페이지를 사용하고 모든 것을 선택했기 때문에 모든 jquery UI 종속성을 사용할 수 있습니다.
프로젝트가 크고, 내가 사용하고있는 코드에 가까운 메이크업 코드를 만들고 있습니다.
첫째, 나 자신을 해결까지 종료 대화
$(".btblock").click(function (event) {
event.preventDefault();
var btn = $(this);
var id= btn.attr('id');
$("#divDialog1").dialog({
dialogClass: 'notitle',
modal: true,
zIndex: 10002,
resizable: false,
closeOnEscape: false,
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
},
buttons: {
"Ok": function() {
//Here I call another function which is an ajax call.
//when the ajax call is completed (success or not) I call
//another function which creates the second dialog with results
$(this).dialog("close");
}
}
});
});
//Function called after ajax call. creats a result dialog
//This Dialog doesn't show in the middle of the screen
function customAlertMessage(title, message) {
var div = '<div style="text-align:center;" title="' + title + '">' + message + '</div>'
$(div).dialog({
resizable: false,
dialogClass: 'notitle',
modal: true,
buttons: {
"Ok": function() {
$(this).dialog("close");
}
}
});
}
어쩌면 코드를 게시 할 수 있습니까? – mituw16
일부 예제 코드로 편집되었습니다. – jpgrassi