Alex Rivera | Logout

Disallow Twitter Bootstrap modal window from closing

Asked 2012-03-27T17:10:49.600
589

I am creating a modal window using Twitter Bootstrap. The default behavior is if you click outside the modal area, the modal will automatically close. I would like to disable that -- i.e. not close the modal window when clicking outside the modal.

Can someone share jQuery code to do this?

Edit
Report

1 Answer

48

If you already have initialized the modal window, then you may want to reset the options with $('#myModal').removeData("modal").modal({backdrop: 'static', keyboard: false}) to make sure it will apply the new options.

answered 2012-07-19T16:41:01.910

Your Answer