2

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

dollar
  • 483
  • 3
  • 11
  • 27
  • I haven't tried anything as I am not getting the solution for this anywhere on internet, so after lot of research on google i finally posted this at stackoverflow. – dollar Sep 24 '16 at 04:11
  • Try to remove background in console. So, you can see where's the style you want to change. I don't recommend to use !important but if you want a simple solution on this problem. You can use it. Try it first – hdotluna Sep 24 '16 at 04:20
  • hi, I just changed the zindex of modal class and it worked as per my requirement, .modal{ z-index: 99999; } – dollar Sep 24 '16 at 04:27
  • Then you should delete this question ;) – Wesley Smith Sep 24 '16 at 04:40
  • sure why not ;) – dollar Sep 24 '16 at 04:45

1 Answers1

2

Try This

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

More Info Here

Sumit patel
  • 3,807
  • 9
  • 34
  • 61