jackhao jackhao - 1 year ago 51
Javascript Question

Bootstrap modal dismiss if user click anywhere else..how to prevent this?

I am using Twitter's Bootstrap modal.

The modal is dismissed whenever the user clicks anywhere else on the screen except the modal.

Is there a way I can prevent this, so the user has to click the Close button to dismiss the modal?

Best,

Answer Source

you can pass these options:

{
  keyboard: false,
  backdrop: 'static'
}