Rag*_*san 3 jquery twitter-bootstrap
我希望在关闭此模态时触发事件.当我们点击关闭按钮或关闭按钮外的任何地方时,模型会关闭
<a href='#part-3' data-toggle='modal' id='sss' style='float:right; color:black;' >view</a></center>
//code for modal
<div class="modal modal-wide fade" id="part-3" >
<div class="modal-dialog" style="min-width:60%">
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" >×</button>
</div>
<div class="modal-body">
<div class="show">
//the html code of form which is popped up
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我可以通过关闭按钮来关闭模式时轻松创建一个jquery事件,给它一个id,但是当用户点击模态外的任何地方时,如何触发/应该是该触发器的名称.
在bootstrap中,当一个模态被关闭/隐藏时,javascript事件已经触发:
$('#myModal').on('hide.bs.modal', function (e) {
// do something...
})
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4367 次 |
| 最近记录: |