在Bootstrap Modal关闭后执行jQuery

Tig*_*n55 2 html jquery twitter-bootstrap

我试图在我的页面上关闭Bootstrap模式后执行一些jQuery代码,我在我的jQuery和所有内容中都有模态的id.我想使用某种类型的jQuery函数,而不是条件if语句.这是我打开的模式,如何在关闭后运行一些jQuery(动画应该是完整的和一切)?

<div id="part_number-modal" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="part_number-modal" aria-hidden="false" style="display: block;">
<!-- the rest of the modal HTML is in here -->
</div>
Run Code Online (Sandbox Code Playgroud)

Aru*_*hny 10

您可以使用隐藏的事件处理程序

当模态完成对用户的隐藏时将触发此事件(将等待CSS转换完成)​​.

$('#part_number-modal').on('hidden.bs.modal', function (e) {
  // do something...
})
Run Code Online (Sandbox Code Playgroud)