我的模态中有一个外部链接,我希望在用户单击该链接后隐藏模态。我怎么做?
这是我的代码:
<div class="modal hide fade" id="modalwindow">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Title</h3>
</div>
<div class="modal-body">
<p>You need to do a search on google.com for that.</p>
</div>
<div class="modal-footer">
<a id="closemodal" href="https://www.google.com" class="btn btn-primary" target="_blank">Launch google.com</a>
</div>
</div>
<script type="text/javascript">
$('#closemodal').modal('hide');
</script>