我有一个Bootstrap Modal来选择事件。如果用户单击X按钮或模式外部,则希望将其发送到默认事件。如何捕获这些事件?
这是我的HTML代码:
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content event-selector">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<center><h1 class="modal-title event-selector-text">Select an Event</h1><center>
</div>
<div class="container"></div>
<div class="modal-body">
<div class="event-banner">
<a href="/?event=1">
<img src="<?php echo IMAGES_EVENT1_LOGO; ?>" width="100%">
</a>
</div>
<div class="event-banner">
<a href="/?event=2">
<img src="<?php echo IMAGES_EVENT2_LOGO; ?>" width="100%">
</a>
</div>
</div>
</div>
</div>
</div>