add listener on boostrap modal closing or fading

Subject:

you can refer to their page http://getbootstrap.com/javascript/#modals

$('#myModal').on('hidden.bs.modal', function (e) { // do something... })

show.bs.modalThis event fires immediately when the show instance method is called. If caused by a click, the clicked element is available as the relatedTarget property of the event.

shown.bs.modalThis event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete). If caused by a click, the clicked element is available as the relatedTarget property of the event.

hide.bs.modalThis 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). loaded.bs.modal This event is fired when the modal has loaded content using the remote option.

 

references: http://stackoverflow.com/questions/24949383/bootstrap-3-modal-how-to-check-if-modal-is-open-or-closed-using-jquery-javascip

2016-03-07 11:48:08gstlouis