Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 移动safari浏览器的滚动问题_Javascript_Html_Css_Scroll_Mobile Safari - Fatal编程技术网

Javascript 移动safari浏览器的滚动问题

Javascript 移动safari浏览器的滚动问题,javascript,html,css,scroll,mobile-safari,Javascript,Html,Css,Scroll,Mobile Safari,我在iPad上的Safari浏览器上遇到了一个奇怪的错误 这是我的密码: CSS: #搜索结果{ 边框样式:无; 背景色:#b00000; 宽度:40%; 最大高度:100%; 位置:固定; 左:40%; 溢出:隐藏; -webkit溢出滚动:触摸; 可见性:隐藏; } HTML: popup div容器无法在mobile Safari中滚动,但如果我消除了Visibly:hidden部分,那么它就可以正常滚动。我真的无法消除可见性:隐藏部分,但我不确定该怎么办。我可以动态地创建div,然后在

我在iPad上的Safari浏览器上遇到了一个奇怪的错误

这是我的密码:

CSS:

#搜索结果{
边框样式:无;
背景色:#b00000;
宽度:40%;
最大高度:100%;
位置:固定;
左:40%;
溢出:隐藏;
-webkit溢出滚动:触摸;
可见性:隐藏;
}
HTML:

popup div容器无法在mobile Safari中滚动,但如果我消除了Visibly:hidden部分,那么它就可以正常滚动。我真的无法消除可见性:隐藏部分,但我不确定该怎么办。我可以动态地创建div,然后在完成后将其删除,但似乎应该有一个更简单的方法


​​

尝试使用
显示:无(隐藏)和
显示:块(可见)而不是


我不知道为什么会修复它,但它似乎起到了作用。

您可以尝试使用
display:none(隐藏)和<代码>显示:改为阻止
(可见)。我不知道这是否有效,但我想值得一试。这很有效。我真的不知道为什么它能工作,而之前的尝试没有,但它成功了。我将把它作为一个答案发布,以便其他人可以从中找到帮助…
position:fixed
在许多移动浏览器上都不起作用(行为类似于
position:absolute
)。我没有iPad,所以我不知道。。。那里行吗?
<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>
function buttonClick() {
    document.getElementById('searchResults').style.visibility = "visible";
}