如何使用最后弹出的模式上的关闭按钮关闭多个引导程序模式 [英] How can I close multiple bootstrap modals with the close button on the last popped modal
本文介绍了如何使用最后弹出的模式上的关闭按钮关闭多个引导程序模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此代码中有2个模式弹出窗口.如何使用第二个弹出模式中的关闭按钮来关闭第一个和第二个模式.
I have 2 modal popups in this code. How can i use the close button on the second popped modal to close the first and the second modal.
<button class="btn btn-default"><a href="#" data-toggle="modal" data-target="#myModal">Open First Modal</a></button>
<div class="modal fade reply-sure" id="myModal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header bg-default">
<h4 class="modal-title">First Modal</h4>
</div>
<div class="modal-body">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal2">Open Second</button>
<button type="button" class="btn btn-info" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade reply-sure" id="myModal2">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header bg-default">
<h4 class="modal-title">Second Modal</h4>
</div>
<div class="modal-body">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close all</button>
</div>
</div>
</div>
</div>
推荐答案
您可以使用$('#myModal, #myModal2').modal('hide');
.
这篇关于如何使用最后弹出的模式上的关闭按钮关闭多个引导程序模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文