close one modal and open a new modal with one button

不羁岁月 提交于 2019-12-03 20:26:07

use:

$("#modal1").modal('hide');
$("#modal2").modal('show');

see: http://getbootstrap.com/javascript/#modals

demo: http://jsfiddle.net/5qCm9/

I had a similar issue and solved it with a generic jQuery solution.

It just hides all modal that are not targeted.

$('button[data-target]').click(function () {
    $('.modal').not($(this).data('target')).modal('hide');
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!