非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
-webkit-overflow-scrolling
CSS
property controls whether or not touch devices use momentum-based scrolling for a given element.
auto
Use "regular" scrolling, where the content immediately ceases to scroll when you remove your finger from the touchscreen.
touch
Use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and removing your finger from the touchscreen. The speed and duration of the continued scrolling is proportional to how vigorous the scroll gesture was. Also creates a new stacking context.
| 初始值 |
auto
|
|---|---|
| 适用于 | scrolling boxes |
| 继承 | yes |
| 计算值 | 如指定 |
| 动画类型 | discrete |
auto | touch
<div class="scroll-touch">
<p>
This paragraph has momentum scrolling
</p>
</div>
<div class="scroll-auto">
<p>
This paragraph does not.
</p>
</div>
div {
width: 100%;
overflow: auto;
}
p {
width: 200%;
background: #f5f9fa;
border: 2px solid #eaf2f4;
padding: 10px;
}
.scroll-touch {
-webkit-overflow-scrolling: touch; /* Lets it scroll lazy */
}
.scroll-auto {
-webkit-overflow-scrolling: auto; /* Stops scrolling immediately */
}
Not part of any standard. Apple has a description in the Safari CSS Reference .
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
-webkit-overflow-scrolling
非标
|
Chrome 不支持 No | Edge 不支持 No | Firefox 不支持 No | IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No | Firefox Android 不支持 No | Opera Android 不支持 No | Safari iOS 完整支持 5 | Samsung Internet Android 不支持 No |
完整支持
不支持
非标。预期跨浏览器支持较差。
overflow:scroll
elements, eliminating the need to set
-webkit-overflow-scrolling: touch
.
-webkit-border-before
-webkit-box-reflect
-webkit-line-clamp
-webkit-mask-attachment
-webkit-mask-composite
-webkit-mask-position-x
-webkit-mask-position-y
-webkit-mask-repeat-x
-webkit-mask-repeat-y
-webkit-overflow-scrolling
-webkit-tap-highlight-color
-webkit-text-fill-color
-webkit-text-stroke
-webkit-text-stroke-color
-webkit-text-stroke-width
-webkit-touch-callout
box-align
box-direction
box-flex
box-flex-group
box-lines
box-ordinal-group
box-orient
box-pack