iOS中的垂直滚动不流畅 [英] Vertical scrolling in iOS not smooth
问题描述
我一直在搜索有关-webkit-overflow-scrolling: touch;
的文档,但是我只能以这种方式使其对我的<body>
元素部分起作用...
I've been searching far and wide through documentation regarding -webkit-overflow-scrolling: touch;
, but I can only get it to work partially for my <body>
element this way...
<body style="-webkit-overflow-scrolling: touch;">
或这样...
<body style="overflow-y: auto; -webkit-overflow-scrolling: touch;">
在iOS中,我的页面将在页面中向下移动大约四分之一,然后停止.因此-webkit-overflow-scrolling: touch
确实对身体的一部分"有效
In iOS, my page will scroll with momentum about a fourth of the way down in the page, but then stop. So -webkit-overflow-scrolling: touch
does work for a "part" of the body
没有此代码,它将在整个页面中滚动,但是没有动量并且动作非常剧烈.
Without this code, it will scroll all of the way through the page, but with no momentum and with a lot of jerky motion.
推荐答案
将-webkit-overflow-scrolling: touch;
应用于网站的所有元素该怎么办:
What about applying the -webkit-overflow-scrolling: touch;
to all elements of your site:
* {
-webkit-overflow-scrolling: touch;
}
您应该创建一个额外的CSS文件,而不要使用css属性.
And you should create an extra CSS file instead of using the css attribute.
这篇关于iOS中的垂直滚动不流畅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!