【发布时间】:2014-07-16 03:47:47
【问题描述】:
我只是在调试一个奇怪的场景,其中覆盖层中的滚动移动一旦到达其边界就会传递给底层元素。所以当覆盖层没有滚动空间时(因此当你点击弹性顶部/底部时),背景层开始滚动。
我尝试了几种解决方案,也检查了这个:Prevent body scrolling but allow overlay scrolling
但目前还没有修复。我已经附上了一个plunker,所以当你在你的iphone或ipad中打开它时你应该会看到效果。
假设我们有以下页面结构:
<html>
<body>
<nav> <!-- The overlay -->
<div></div> <!-- The scrollable container with appropriate overflows -->
</nav>
<div class="page-wrap"></div> <!-- Main content starts to scroll when overlay reaches bounds or ios top/bottom bars are displayed -->
</body>
</html>
干杯!
Plunkr:http://run.plnkr.co/g4WQrNibWNbz5lYr/
**注意:显示 ios 标题和底栏时似乎有问题。我将尝试添加视频以进行进一步说明**
【问题讨论】:
-
刚刚发现即使在pinterest.com上也会出现这种行为
标签: html css ios7 scroll overlay