Change backdrop to static for open bootstrap modal

后端 未结 5 2052
感情败类
感情败类 2020-12-19 05:33

Can I change backdrop to \'static\' while my modal is open?

I have modal with form submit button. When I click this button I show loading spinner on my modal and th

5条回答
  •  隐瞒了意图╮
    2020-12-19 06:02

    I had a modal that could be opened 2 different ways. When the user opened it one way, I wanted them to be able to close the modal. When they opened it the other way I didn't want them to be able to close it.

    I found this question and used the solution from the original poster. I also tried adding keyboard which now works:

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

提交回复
热议问题