Bootstrap V4模态效果背景不稳定

时间:2017-10-17 16:28:48

标签: jquery css twitter-bootstrap bootstrap-modal bootstrap-4

enter image description here使用表单网址栏打开模态。当用户单击某个栏时,Modal将打开,其中包含URL栏和网站名称。现在问题是当模态打开并且用户将光标移动到开始栏的区域时,背景栏变为白色或打扰。

我试过的Bootstrap代码

<div class="container-fluid">

   <!-- Form trigger modal -->
<form action="testiing bars.php" method="get" data-toggle="modal" data-target="#formModal">
    <div class="form-group">
    <label for="inputlg"></label>
    <input class="form-control input-lg" id="inputlg" type="text" name="website">
  </div>
</form>

<!-- Modal -->
<div class="modal fade" id="formModal" tabindex="-1" role="dialog" aria-labelledby="formModal" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle">Submit URL</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

任何想法如何解决这个问题。?

1 个答案:

答案 0 :(得分:0)

我使用此代码将背景滚动添加到弹出窗口作为可用性功能,可能会有所帮助:

/*allow modal scroll behind*/
html { overflow-y: scroll !important; }
body .modal-open { overflow: visible; }