gpt4 book ai didi

ios - 无法在 ios 上的可滚动区域内创建可滚动区域

转载 作者:可可西里 更新时间:2023-11-01 05:42:50 24 4
gpt4 key购买 nike

以下代码在桌面和安卓手机上运行良好,但在 ios 上不起作用。如果能帮助我朝着正确的方向前进,我将不胜感激。

https://jsfiddle.net/slash197/047c4dj8/6/

html, body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
}
.holder {
position: relative;
width: 100%;
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
.content {
width: 100%;
height: 128px;
overflow-y: hidden;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
}
.row {
width: 3000px;
height: 100%;
background-image: -webkit-linear-gradient(
left,
rgba(0, 0, 255, 0.0) 0%,
rgba(0, 0, 255, 1.0) 100%
);
}


<div class="holder">
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
</div>

最佳答案

IOS Safari 忽略了百分比宽度,将其更改为 px,它将开始工作,检查下面的 fiddel 链接。

    <!DOCTYPE html>
<html>
<head>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
}
.holder {
position: relative;
width: 1000px;
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
-webkit-overflow-scrolling-x: touch !important;
}
.content {
width: 1000px;
height: 128px;
display:block;
float:left;
overflow-y: hidden;
overflow-x: scroll;
-webkit-overflow-scrolling-x: touch !important;
}
.row {
width: 3000px;
height: 100px;
display:block;
float:left;
background-image: -webkit-linear-gradient(
left,
rgba(0, 0, 255, 0.0) 0%,
rgba(0, 0, 255, 1.0) 100%
);
}
</style>
</head>
<body>
<div class="holder">
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
<div class="content">
<div class="row"></div>
</div>
</div>
</body>
</html>

https://jsfiddle.net/pe6t29kf/11/

关于ios - 无法在 ios 上的可滚动区域内创建可滚动区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48537933/

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