我想在打开一个jquery对话框并将选项模式设置为true之后启用一个按钮。该按钮显然位于对话框之外。我已经知道这似乎是一个奇怪的请求,但我需要这种行为,因为对话框中有一个表单,因此单击按钮提交数据后,我必须将对话框附加到表单末尾,然后单击 agin现在位于对话框之外的按钮上。
提前谢谢您。
最佳答案
使用打开对话框时触发的 open 事件
$( ".selector" ).dialog({
open: function(event, ui) {
$('#yourhiddenbutton').show();
}
});
编辑 - 你可以这样做
$(function() {
$("#dialogRifiuto").dialog({
width: 'auto',
autoOpen: true,
closeOnEscape: true,
modal: true,
resizable: false,
open: function(){
//change the z-index and position the div where you want
$('#a').css({'z-index': 1005, 'position': 'absolute', 'top': 0 });
},
close: function(){
//go back to normal
$('#a').css({'z-index': 1, 'position': 'static' });
}
})
});
关于javascript - 打开jquery对话框后启用模式为true的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10174982/