bootstrap js on open modal event code example
Example 1: call function on modal open
$('#myModal').on('shown.bs.modal', function (e) {
// do something...
})
Example 2: bootstrap on hidden bs modal
$('#myModal').on('hidden.bs.modal', function (e) {
// do something...
})