gpt4 book ai didi

jquery - Scroll 在 Phonegap 应用程序中无缘无故地显示自己

转载 作者:行者123 更新时间:2023-11-28 06:48:08 25 4
gpt4 key购买 nike

我正在使用 Phonegap build 构建应用程序。该应用程序只是另一个带有输入字段和“插入”按钮的列表应用程序。用户在键入他想要保存的短语并按下按钮以插入值后,该值显示在滚动框中。这是滚动框的代码(HTML、jQuery、CSS):

<script>
$( document ).ready(function() {
center();
});

function center(){
var wh = $(window).height()*0.56;
$('#demo').css({'height':wh+'px'});
}
</script>

<div class="container">
<div class="row">

<div id="demo" align="center" class="col-md-12"></div>

</div>
</div>

<style>
#demo {
overflow: scroll;
padding-left: 30px;
height: 200px;
width: 100%;
}
</style>

#demo 是滚动框所在的地方。我的问题是: enter image description here

即使我第一次打开应用程序,滚动条也会自行显示。我在很多手机上试过,其中一半有这个问题,而在其他手机上没有出现滚动条。我在网上搜索但找不到类似的问题。你知道我怎样才能让滚动条变得不可见吗?提前致谢。

最佳答案

您是否尝试设置 overflow-x: hidden;overflow-y: auto;?如果不是这样尝试使用它

<style>
#demo {
overflow-y: auto;
overflow-x: hidden;
padding-left: 30px;
height: 200px;
width: 100%;
}
</style>

关于jquery - Scroll 在 Phonegap 应用程序中无缘无故地显示自己,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33927309/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com