Updated for Bootstrap 3
Bootstrap 3 documentation refers two events you can use
hide.bs.modal: This event is fired immediately when the hide instance method has been called.
hidden.bs.modal: This event is fired when the modal has finished being hidden from the user (will wait for CSS transitions to complete).
And provides an example on how to use them:
$('#myModal').on('hidden.bs.modal', function () {
// do something…
})
$('#myModal').on('show.bs.modal', function (e) {
if (!data) return e.preventDefault() // stops modal from being shown
})
Legacy Bootstrap 2.3.2 answer
Bootstrap's documentation refers two events you can use
hide: This event is fired immediately when the hide instance method has been called.
hidden: This event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
And provides an example on how to use them:
$('#myModal').on('hidden', function () {
// do something…
})
$('#myModal').on('show', function (e) {
if (!data) return e.preventDefault() // stops modal from being shown
})
本文介绍了如何使用Bootstrap的模态框事件,包括hide.bs.modal和hidden.bs.modal等,并提供了具体的代码示例。还包含了Bootstrap2.3.2及Bootstrap3的相关内容。

被折叠的 条评论
为什么被折叠?



