BillPull BillPull - 5 months ago 3x
Javascript Question

Bind a function to Twitter Bootstrap Modal Close

I am using the Twitter Bootstrap lib on a new project and I want for part of the page to refresh and retrieve the latest json data on modal close. I dont see this anywhere in the documentation can someone point it out to me or suggest a solution.

Two problems with using the documented methods

$('#my-modal').bind('hide', function () {
// do something ...

I attach a "hide" class to the modal already so it does not display on page load so that would load twice

even if I remove the hide class and set the element id to "display:none" and add "console.log("THE MODAL CLOSED");" to the function above when I hit close nothing happens.


Bootstrap 3

$('#myModal').on('', function () {
    // do something…
}) -> Events

Bootstrap 2.3.2

$('#myModal').on('hidden', function () {
    // do something…
}) -> Events