我正在尝试使用简单的Bootstrap模态框,但是在任何地方点击它都会关闭,而不仅仅是点击关闭按钮。我在页面上没有使用任何其他额外的JavaScript或jQuery代码。这是我的代码链接,模态框触发按钮在底部。
http://aijaz.co/angloamerican/
这是我正在使用的默认代码。
<a data-toggle="modal" href="#myModal" class="btn btn-primary btn-large">Launch demo modal</a>
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p>Do you want to save changes you made to document before closing?</p>
<p class="text-warning"><small>If you don't save, your changes will be lost.</small></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>