The Modal box class of Bootstrap provides some events for listening and executing your own code.
Event Type description
The event is triggered immediately after the Show.bs.modal Show method call. If you click on an element that is a trigger, this element can be accessed through the Relatedtarget property of the event.
Shown.bs.modal This event is triggered after the modal box has been displayed (and at the same time the CSS transition effect is complete). If you click on an element that is a trigger, this element can be accessed through the Relatedtarget property of the event.
The event is triggered immediately after the Hide.bs.modal hide method call.
Hidden.bs.modal This event is triggered after the modal box is hidden (and at the same time the CSS transition effect is complete).
Loaded.bs.modal fires the event after it has loaded data from the remote data source.
JS Code:
$ (' #myModal '). On (' Hidden.bs.modal ', function (e) {
Do something ...
})
Bootstrap Modal Frame class