Bind function with Bootstrap Modal Close : Sometimes we need to bind function with Modal close event. $(‘#modal’).on(); is used to bind a function with the close event. This method can be used to trigger the function when the close event occurs. Here in this tutorial we are going to explain how you can call function on modal close event. We will explain this with online demo.
Bind function with Bootstrap Modal Close
You can call function on bootstrap modal close event as below –
Bootstrap 3 : Call Function On Modal Close Event
If you are using the bootstrap 3 you can call a function on close event as below –
If you run the above example and click on the modal popup to close it trigger the alert on close event.
Bootstrap 2.3.3 : Call Function On Modal Close Event
If you are using the bootstrap 2.3.3 you can call a function on close event as below –
Call function on Bootstrap Modal Close Button Click : Example
|
This will work same as the above example .