iOS 中包含 position:sticky 元素的可滚动 iFrame

Scrollable iFrame with position:sticky element in iOS

我想创建一个内部有 position:sticky 元素的可滚动 iFrame,它也适用于 iOS。

iOS 不遵守 iFrame height:340px 设置, 解决方法 仍然使其滚动的容器 div 与 overflow-y:auto;-webkit-overflow-scrolling: touch;(参见 Iframe scrolling iOS 8)。

但是当只有外部 div 滚动时 position:sticky 不工作。是否有任何其他解决方案可以使 iFrame 可滚动?

在网络浏览器上查看此处与 iOS: https://codepen.io/arichter83/project/full/ZWGEaL

好的,我找到了解决方案 - 包装所有 iFrame 内容会使 div 容器过时:

#wrap {
    position: fixed;
    top: 0;
    right:0;
    bottom:0;
    left: 0;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

https://github.com/PierBover/ios-iframe-fix