aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/overscroll-behavior-y/index.html
blob: 2bea0c98963f512a78e45acb59107715a975069e (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
---
title: overscroll-behavior-y
slug: Web/CSS/overscroll-behavior-y
translation_of: Web/CSS/overscroll-behavior-y
---
<div>{{CSSRef}}</div>

<p><span class="seoSummary"><strong><code>overscroll-behavior-y</code></strong></span> <span class="seoSummary">这个CSS属性用来控制当滚动到区域的垂直边界时的浏览器行为。</span></p>

<div class="note">
<p><strong>Note</strong>: 详细的解释请访问 {{cssxref("overscroll-behavior")}}</p>
</div>

<pre class="brush:css no-line-numbers">/* Keyword values */
overscroll-behavior: auto; /* default */
overscroll-behavior: contain;
overscroll-behavior: none;

/* Global values */
overflow: inherit;
overflow: initial;
overflow: unset;
</pre>

<p>{{cssinfo}}</p>

<h2 id="语法">语法</h2>

<p><code>overscroll-behavior-y</code> 属性可以选用下列值。</p>

<h3 id="值"></h3>

<dl>
 <dt><code>auto</code></dt>
 <dd>默认的滚动溢出行为表现的和正常一样。 .</dd>
 <dt><code>contain</code></dt>
 <dd>默认的滚动溢出行为将被内部的元素观察到,(例如: “bounce”效果或者刷新),但是相邻的区域不会产生连续滚动效果,例如: 在下面的元素不会被滚动。</dd>
 <dt><code>none</code></dt>
 <dd>相邻的滚动区域不会有连续滚动效果,并且默认的滚动溢出行为会被阻止。</dd>
</dl>

<h3 id="正式语法">正式语法</h3>

{{csssyntax}}

<h2 id="示例">示例</h2>

<pre class="brush: css">.messages {
  height: 220px;
  overflow: auto;
  overscroll-behavior-y: contain;
} </pre>

<p>详细的解释请访问 {{cssxref("overscroll-behavior")}}</p>

<h2 id="规格">规格</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">规格</th>
   <th scope="col">状态值</th>
   <th scope="col">备注</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('Overscroll Behavior', '#propdef-overscroll-behavior-y', 'overscroll-behavior-y')}}</td>
   <td>{{Spec2('Overscroll Behavior')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>



<p>{{Compat("css.properties.overscroll-behavior-y")}}</p>

<h2 id="参见">参见</h2>

<ul>
 <li><a href="https://developers.google.com/web/updates/2017/11/overscroll-behavior#demo">Take control of your scroll: customizing pull-to-refresh and overflow effects</a></li>
</ul>