Tag Archives: jquery tips

jQuery – Bind events to opening and closing a Bootstrap modal

Cause an event to be triggered when opening and closing a Bootstrap (3+) modal window.

Modal Close:

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

Modal Open:

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

 

Share this post:
read more