3 回答

TA贡献1850条经验 获得超11个赞
为了解决这个问题,我改变了我的代码是这样的:
$().ready(function () {
$("#saveBtn").on('click', function () {
$('#modalAddressees').modal('hide');
$('#modalNewAddress').modal('show');
});
});

TA贡献1829条经验 获得超13个赞
在隐藏的 bs 模态 id: modalAddAddress 显示模态 id: modalNewAddress
$('#modalAddressees').on('hidden.bs.modal', function () {
$('#modalNewAddress').modal('show');
})
似乎它像你写的那样工作。

TA贡献1866条经验 获得超5个赞
Javascript
$().ready(function () {
const modalA = $('#modalAddressees');
$("#saveBtn").on('click', function () {
modalA.modal('hide')
modalA.off('hidden.bs.modal').on('hidden.bs.modal', function () {
modalA.modal('show');
})
});
});
或者
$().ready(function () {
const modalA = $('#modalAddressees');
modalA.on('hidden.bs.modal', function () {
modalA.modal('show');
});
$("#saveBtn").on('click', function () {
modalA.modal('hide');
});
});
添加回答
举报