移动safari浏览器的滚动问题
Scrolling issues with mobile safari browser
我在iPad上的Safari浏览器上遇到了一个奇怪的错误。
这是我的代码:
CSS:
#searchResults {
border-style: none;
background-color:#b00000;
width:40%;
max-height:100%;
position:fixed;
left:40%;
overflow:hidden;
-webkit-overflow-scrolling:touch;
visibility:hidden;
}
HTML:
<button onClick = "buttonClick()"/>
<div id="searchResults">
hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>hello<br>
</div>
JS:
function buttonClick() {
document.getElementById('searchResults').style.visibility = "visible";
}
弹出的div容器不能在移动Safari中滚动,但如果我消除了visiblity:hidden部分,它就会滚动得很好。我真的无法消除可见性:隐藏部分,但我不知道该怎么办。我可以动态创建div,然后在完成后将其删除,但似乎应该有一个更简单的方法。
请参阅Fiddle
请尝试使用display: none;
(隐藏)和display: block;
(可见)。
我不知道为什么这样可以修复它,但它似乎起到了作用。
相关文章:
- Safari(Mac OS)上的jQuery平滑滚动问题
- jquery平滑滚动问题
- Wordpress中奇怪的滚动问题
- CSS 溢出的滚动问题:滚动 HTML
- 移动safari浏览器的滚动问题
- JQuery在滚动问题上添加类
- 多个引导模式的滚动问题
- jQuery自动完成滚动问题
- 可拖动弹出-滚动问题
- Jquery浏览器滚动问题
- 数据表垂直滚动问题
- IE 的画布外滚动问题
- jQuery fadeOut / fadeIn Chrome 中的滚动问题
- 基础 - 画布外滚动问题
- 灯箱演变防止窗口滚动问题
- 触摸事件的挖空事件绑定导致滚动问题
- 冻结列垂直滚动问题
- 单页滚动问题
- 三.JS - 火狐浏览器的滚动问题
- 在滚动问题上向下滑动菜单