Bootstrap Modal Backdrop Remaining

前端 未结 24 2081
被撕碎了的回忆
被撕碎了的回忆 2020-12-23 08:55

I am showing a Bootstrap modal window for loading when performing AJAX calls. I broadcast a \"progress.init\" event when the loading modal should show and a \"progress.finis

24条回答
  •  误落风尘
    2020-12-23 09:30

    If the close dismiss button is working but the problem occurs when using dynamic code such as modal('hide') you can use this code. forcing the backdrop to totally remove.

    for Bootstrap 3

    $modal.on('hidden.bs.modal', function(){
      //remove the backdrop
      jQuery('[data-dismiss="modal"]').click();
    });
    
    yourbutton.click(function() {
      $modal.modal('hide');
    });
    

提交回复
热议问题