bootstrap 3 disable background after modal popup [duplicate]

删除回忆录丶 提交于 2019-12-24 02:05:28

问题


I am trying to popup bootstrap 3 modal in my code using below given code

  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="false" aria-hidden="true" data-keyboard="false">
  <div class="modal-dialog" role="document">
      <div class="modal-content">
          <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
  <div class="modal-body">
    ...
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    <button type="button" class="btn btn-primary">Save changes</button>
  </div>
  </div>
  </div>
  </div>

I want to disable background completely and only modal should be active at the time, like this

I want like this given below

and this is what I am getting


回答1:


Try This

$('#myModal').modal({backdrop: 'static', keyboard: false})  ;

More Info Here



来源:https://stackoverflow.com/questions/39672346/bootstrap-3-disable-background-after-modal-popup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!