gpt4 book ai didi

Android 浏览器禁用 x 滚动也会禁用 y 滚动

转载 作者:太空宇宙 更新时间:2023-11-03 18:41:37 25 4
gpt4 key购买 nike

我有一个移动网页,我禁用了水平滚动,因为它干扰了我正在做的一些动画。但是,当我在 html 和 body 上设置 overflow-x:hidden 时,android 出于某种原因失去了垂直滚动的能力。 iPad 似乎仍然可以正常工作。如果重要的话,我在 android 2.3 上

这是问题的一些示例代码:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<style type="text/css">
html,body {
position:absolute;
height:100%;
width:100%;
padding:0px;
margin:0px;
overflow-x:hidden;
}

.content span {
white-space:nowrap;
display:block;
}
</style>
</head>
<body>
<div class="content">
<span>Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling. Really long line to force horizontal scrolling.</span>

<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>

<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>

<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>

<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>

<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>

<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
<span>5</span>
<span>6</span>
<span>7</span>
<span>8</span>
<span>9</span>
</div>
</body>
</html>

最佳答案

我有一个类似的问题,但从我到现在看到的是什么阻止了滚动

height: 100%;

尝试评论 Android 2.X 的留置权,您可能会让它再次滚动。

如果你找到了一个可以保留的方法,请告诉我们

html, body {
height: 100%;
}

仍然滚动。

谢谢,祝你好运-

关于Android 浏览器禁用 x 滚动也会禁用 y 滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17459303/

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