blob: 33c9fd5ed1dc6f75c7035e7ef6e409afd4743b8d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
---
title: '-webkit-overflow-scrolling'
slug: Web/CSS/-webkit-overflow-scrolling
tags:
- CSS
- Non-standard
- Reference
translation_of: Web/CSS/-webkit-overflow-scrolling
---
<p>{{CSSRef}}{{Non-standard_header}}</p>
<h3 id="概述">概述</h3>
<p><strong><code>-webkit-overflow-scrolling</code></strong> 属性控制元素在移动设备上是否使用滚动回弹效果.</p>
<h3 id="值">值</h3>
<dl>
<dt><code>auto</code></dt>
<dd>使用普通滚动, 当手指从触摸屏上移开,滚动会立即停止。</dd>
<dt><code>touch</code></dt>
<dd>使用具有回弹效果的滚动, 当手指从触摸屏上移开,内容会继续保持一段时间的滚动效果。继续滚动的速度和持续的时间和滚动手势的强烈程度成正比。同时也会创建一个新的堆栈上下文。</dd>
<dt>
<h3 id="示例">示例</h3>
<pre class="brush: css">-webkit-overflow-scrolling: touch; /* 当手指从触摸屏上移开,会保持一段时间的滚动 */
-webkit-overflow-scrolling: auto; /* 当手指从触摸屏上移开,滚动会立即停止 */
</pre>
</dt>
</dl>
<h3 id="Browser_Compatibility" name="Browser_Compatibility">规范</h3>
<p>尚未有相关规范。另在Apple提供的<a href="https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html#//apple_ref/css/property/-webkit-overflow-scrolling">Safari CSS 参考文档</a>中有所提及。</p>
<h3 id="Browser_Compatibility" name="Browser_Compatibility">浏览器兼容性</h3>
<p>{{CompatibilityTable}}</p>
<table>
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari (WebKit)</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Phone</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>5.0</td>
</tr>
</tbody>
</table>
<h3 id="相关链接:">相关链接:</h3>
<ul>
<li><a href="http://css-tricks.com/snippets/css/momentum-scrolling-on-ios-overflow-elements/">CSS-Tricks article with demo</a> </li>
<li><a href="https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariCSSRef/Articles/StandardCSSProperties.html#//apple_ref/css/property/-webkit-overflow-scrolling"><code>-webkit-overflow-scrolling</code> entry in Safari CSS Reference docs</a></li>
</ul>
|