bootstrap 3 disable background after modal popup

20,196

Try This

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

More Info Here

Share:
20,196
dollar
Author by

dollar

I am PHP Developer.

Updated on August 21, 2020

Comments

  • dollar
    dollar over 3 years

    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 enter image description here

    and this is what I am getting enter image description here