我找不到关于这个问题的相关信息。
如果父容器具有固定高度和overflow:scroll,则内部iframe将无法正常滚动。它只能向底部或顶部滚动。但是不能同时滚动。
如果我从#outer容器中删除overflow:scroll;,则可以正常工作。
请查看附加的代码片段并在Safari中运行它。
目前,我正在使用Safari版本9.0.3,OS X El Capitan 10.11.3
更新: 我发现这个错误只能使用Apple输入设备(Magic Mouse或触摸板)重现。 看看视频: https://www.youtube.com/watch?v=2IpjAbWgbuc
我无法在片段中重现此错误,因此这是实际的HTML页面:
https://s3-eu-west-1.amazonaws.com/plio/other/iframe_scroll_safari_issue.html
* {
box-sizing: border-box;
}
#outer {
height: 500px;
width: 500px;
margin: 0 auto;
padding: 60px;
overflow: scroll;
}
#inner1, #inner2 {
height: 300px;
margin-bottom: 50px;
}
#scrollable1, #scrollable2 {
height: 100%;
width: 100%;
overflow: scroll;
}
#scrollable1 > *, #scrollable2 > * {
border: 3px dashed;
width: 100%;
}
<!DOCTYPE html>
<html>
<body>
<div id="outer">
<div id="inner1">
<div id="scrollable1">
<img src="http://static.fjcdn.com/pictures/Long_3c2320_670942.jpg">
</div>
</div>
<div id="inner2">
<iframe id="scrollable2" src="https://plio.s3.amazonaws.com/uploads/KwKXz5RefrE5hjWJ2/standards-files/HLiWGZdNL5hifyRhJ/YCWzyS3XX2Wkko6tv-demo.docx.html"></iframe>
</div>
</div>
</body>
</html>