close
이벤트가 발생하면, (a .ui-dialog
단순히 요소를 숨기는 폐쇄) 볼 수있는 div.ui-dialog
확인하고 최고 z-index
있다. 그런 다음 해당 대화 상자에 포커스를 설정하십시오. 이것은 가장 효율적일 수는 없지만 작동합니다 :
// ...
close: function() {
var index_highest = 0;
var current_dialog = null;
$('.ui-dialog').each(function() {
// we only care about dialogs that are visible
if ($(this).is(':visible')) {
// always use a radix when using parseInt
var index_current = parseInt($(this).css("zIndex"), 10);
if(index_current > index_highest) {
index_highest = index_current;
current_dialog = $(this);
}
}
});
if (current_dialog) { current_dialog.focus(); }
}
// ...
. 크레딧 justkt's answer은 jQuery를 사용하여 가장 높은 z- 인덱스를 가진 요소를 찾는 것에 관한 것입니다.