在iOS上,防止滚动过去的内容(使其像Android一样),防止过度滚动行为

w1jd8yoj  于 2023-03-31  发布在  iOS
关注(0)|答案(1)|浏览(173)

我有一个位置:固定容器,其中包含我可以滚动查看的内容。在iOS上,我可以滚动内容,查看内容下方的容器。这在Android上不会发生。我可以让iOS像Android一样吗?
在iOS上,我可以滚动查看黄色的容器背景。在Android上我不能:
https://jsfiddle.net/45enwzdf/1/

<div id = "container">
    <div id="contents">
    start
    </div>
</div>

#container{
  position:fixed;
  height:100px;
  width:200px;
  background:yellow;
  overflow: hidden;
  overflow-y: scroll;
  border:1px black solid;
}

#contents{
  height:1000px;
  width:200px;
  background:green;
}
zbsbpyhn

zbsbpyhn1#

尝试添加=〉overscroll-behavior:无;

#container{
  position:fixed;
  height:100px;
  width:200px;
  background:yellow;
  overflow: hidden;
  overflow-y: scroll;
  border:1px black solid;
  overscroll-behavior: none;
}

相关问题