无法在iOS上的Bootstrap模式下滚动iframe

时间:2018-11-30 07:25:39

标签: html css twitter-bootstrap modal-dialog

我做了一个简单的演示来展示我的问题。仅在iOS上会发生此问题。

HTML

<!-- Button to Open the Modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
  Open modal
</button>

<!-- The Modal -->
<div class="modal" id="myModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-body">
          <iframe src="https://tma.ee/test.htm"> </iframe>
      </div>
    </div>
  </div>
</div>

CSS

iframe {
  width: 100%;
  border: 0;
  min-height: 350px;
}

.modal-body {
  -webkit-overflow-scrolling: touch !important;
  overflow-x: auto !important;
}

我已经尝试过在这里针对stackoverflow提出的多种解决方案,但是到目前为止,这些解决方案中没有一个对我有用。

JSFiddle:https://jsfiddle.net/MulOnPomm/bvk1dmxt/11/

用于iOS测试的全屏屏幕:http://fiddle.jshell.net/MulOnPomm/bvk1dmxt/1/show/light/

我用于测试的iOS模拟器:https://appetize.io/

1 个答案:

答案 0 :(得分:1)

Try using the option overflow: scroll; inside the iframe property in css

iframe {
     overflow: scroll;
 width: 100%;
  border: 0;
  min-height: 350px;
}

else refer this link or this issues may help you