我做了一个简单的演示来展示我的问题。仅在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/