非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

-ms-scroll-snap-points-y CSS 特性为 Microsoft extension that specifies where snap-points will be located along the y-axis.

初始值 snapInterval(0px, 100%)
适用于 non-replaced block-level elements and non-replaced inline-block elements
继承 no
计算值 如指定
动画类型 discrete

句法

Note: a <length-percentage> is a value that can be either a <length> <percentaqe> .

snapInterval( <length-percentage>, <length-percentage> )

Specifies a starting snap-point followed by the interval between all snap-points.

  • The first value specifies where the first snap-point will be placed.
  • The second value specifies the distance between subsequent snap-points both above and below the initial snap-point.
snapList( <length-percentage># )

Specifies the position of individual snap-points as a comma-separated list of values, each of which represents a zoom factor.

形式句法

  snapInterval( <length-percentage>, <length-percentage> ) | snapList( <length-percentage># )

where
<length-percentage> = <length> | <percentage>

范例

This example demonstrates both types of values for the -ms-scroll-snap-points-y property. In the first selector, the first snap-point is at 0%, and the interval is set to 100%. In the second selector, each snap-point is listed separately — 100%, 200%, 300%, and so on. (The -ms-scroll-snap-points-y property behaves identically to the -ms-scroll-snap-points-x property, but along the y-axis.)

.container {
  overflow-x: auto;
  overflow-y: hidden;
  -ms-scroll-snap-type: mandatory;
  -ms-scroll-snap-points-y: snapInterval(0%, 100%);
  width: 480px;
  height: 270px;
}
.imageContainer {
  -ms-scroll-chaining: chained;
  -ms-overflow-style: none;
  -ms-content-zooming: zoom;
  -ms-scroll-rails: none;
  -ms-scroll-limit-y-min: 100%;
  -ms-scroll-limit-y-max: 500%;
  -ms-scroll-snap-type: proximity;
  -ms-scroll-snap-points-y: snapList(100%, 200%, 300%, 400%, 500%);
  -ms-overflow-style: none;
  width: 480px;
  height: 270px;
  overflow: auto;
}
					

规范

Not part of any specification.

备注

This property requires Windows 8 or later.

This property has no effect on non-scrollable elements.

Starting with Windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.

另请参阅

元数据

  • 最后修改:
  1. CSS
  2. CSS 参考