在触控板或触摸屏上快速滑动时,scroll-snap-stop
属性指定是滚动过去的元素还是停止并捕捉下一个元素。
为了控制滚动快速停止行为,scroll-snap-stop
和scroll-snap-align
必须在子元素上设置属性,并且scroll-snap-type
属性必须设置在父元素上。
笔记:您必须在带有触控板或触摸屏的设备上使用滑动手势才能体验效果scroll-snap-stop
属性。
表中的数字指定完全支持该属性的第一个浏览器版本。
Property | |||||
---|---|---|---|---|---|
scroll-snap-stop | 75.0 | 79.0 | 103.0 | 15.0 | 62.0 |
scroll-snap-stop: normal|always|initial|inherit;
Value | Description |
---|---|
normal | Default value. After fast swipe with touchpad or touch screen, the scrolling slows down slowly and passes several elements. |
always | After fast swipe with touchpad or touch screen, scrolling stops and the next element snaps into focus. |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
CSS 滚动对齐属性:CSS 滚动对齐属性
CSS 滚动捕捉类型属性:CSS Scroll-snap-type 属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!