By default, a modal closes by clicking on the overlay, clicking the x
in the modal, and by hitting the ESC
key.
To close a modal via JavaScript, simply call $.modal.close();
.
Similar to how links can be automatically bound to open modals, they can be
bound to close modals using rel="modal:close"
:
<a href="#close" rel="modal:close">Close Modal</a>
<!-- Modal Markup -->
<section id="closeExample" class="bpModal">
<header class="bpModal-header">
<h1 class="bpModal-title">Modal Title</h1>
</header>
<div class="bpModal-body">
<p>Modal content</p>
<p><a href="#close" rel="modal:close">Close Modal</a></p>
</div>
</section>
<a href="#closeExample" data-modal>Open Modal</a>