我在對話框UI中遇到了一個小問題。我將zIndex值標記爲高數字,但似乎它忽略了它。如何使用jQuery對話框修復zIndex問題UI
下面是我的代碼
$("#number-add").dialog({
resizable: false,
width: 500,
modal: false,
autoOpen: false,
stack: false,
zIndex: 9999,
buttons: {
"Add Contact": function(e) {
var formData = $('#number-add-form').serialize();
//submit record
$.ajax({
type: 'POST',
url: 'ajax/handler-add-new-account-number.php',
data: formData,
dataType: 'json',
cache: false,
timeout: 7000,
success: function(data) {
$('#responceAddNumber').removeClass().addClass((data.error === true) ? 'errorBox' : 'passBox').html(data.msg).fadeIn('fast');
if ($('#responceAddNumber').hasClass('passBox')) {
$('#responceAddNumber').fadeIn('fast');
$('#add-form').hide();
window.location.reload();
setTimeout(function() {
$(this).dialog("close");
}, 1000);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
$('#response-add').removeClass().addClass('errorBox')
.html('<p>There was an<strong> ' + errorThrown +
'</strong> error due to a<strong> ' + textStatus +
'</strong> condition.</p>').fadeIn('fast');
},
complete: function(XMLHttpRequest, status) {
if ( $('#response-add').hasClass('passBox')){
$('form')[0].reset();
}
}
});
},
Cancel: function() {
$(this).dialog("close");
}
}
});
我堆棧值設置爲false,並且用zIndex到9999我在做什麼錯在這裏爲zIndex的不工作?我正在使用jQuery UI對話框1.10.2。
感謝您的幫助。
@布萊克的答案也適用於我 - 但錯字。 .css('zIndex',...)應該是.css('z-index',...) –