【发布时间】:2018-04-30 22:39:35
【问题描述】:
我的页面由一个 iframe 和一些溢出视口的额外内容组成:
当用户尝试在 iframe 上滚动时,滚动事件在 iframe 内触发,出于安全原因,父窗口对此一无所知。
但是因为 iframe 比它的内容高,它不需要任何滚动,因此应该将滚动事件传播到父窗口。
它在this example 中按预期工作。
但是,一旦 iframe 被包含在带有 overflow: auto 或 scroll 的 div 中,它就不再适用于 iOS (11.3.1),正如您在 this other example 中看到的那样。
有谁知道如何解决这个问题?任何帮助表示赞赏!
我尝试了什么
-
overflow: hidden在 iframe 上 -
-webkit-overflow-scrolling: touch在 iframe 上 -
iframe 标签上的
scrolling="no"属性 -
iframe 上的
pointer-events: none修复了滚动问题,但你can't interact with the iframe anymore
【问题讨论】:
-
你有解决办法吗?
标签: ios css iframe scroll overflow