下面是我的代码:
如何在此对话框中显示“确定”按钮?
$("#success").dialog({
modal: true,
title: 'Payment success',
width: 400,
});
如何在此对话框中显示“确定”按钮?
$("#success").dialog({
modal: true,
title: 'Payment success',
width: 400,
});
使用 Buttons 选项 并查看 模态消息。
$("#success").dialog({
modal:true,
title:'Payment success',
width:400,
buttons: {
Ok: function() {
$( this ).dialog( "close" );
}
}
});
$("#success").dialog({modal:true,title:'Payment success',width:400,buttons{"Ok":execute,"Cancel": cancel}});
var execute = function()
{
alert('This is Ok button');
}
var cancel = function()
{
alert('This is Cancel button');
}
那应该可以工作。
$("#success").dialog({
modal:true,
title:'Payment success',
width:400,
buttons: {
Ok: function() {
$(this).dialog('close');
}
});
这应该会添加一个带有“确定”文本的按钮,当你点击按钮时,对话框将关闭 :)
buttons: {"ok": function() {}}
。 - mohkhan