Boostrap Modal几个小技巧

$(‘.modal’).modal({backdrop: ‘static’, keyboard: false});

设置backdrop:static时点击空白处modal不关闭.

设置keyboard:false时点击键盘ESCmodal不关闭.

或者在modal div上设置data-backdrop="static" data-keyboard="false"属性亦可