4

I want to change modal behavior after certain event.

$('.myModal').modal('show'); // default behavior - user can close modal on ESC
$(button).click(function(){
    $('.myModal').modal({keyboard:false}); // override 
                                           // prevous line code does not work as i expect,
                                           // user can close modal with ESC
    $('.myModal').data('modal').option.keyboard = false; // even this code doesn't work
});

Any help will be appreciated

4

1 回答 1

1

我有同样的问题,我使用了错误的数据...

你可以试试这个(考虑到bt3):

$('#myModal').data('bs.modal').options.keyboard=false;

如果模态已打开,则它不起作用,您需要刷新它。

于 2013-12-26T14:31:00.000 回答