注意到它也出现在我的Chrome Inspector中,这引导我发布这篇帖子……
什么是滚动行为?
特别称为CSSOM-View’Scroll-Behavior’属性,创建了css属性以集成更多的CSS项目滚动灵活性.大多数为网站构建的“滚动”选项通常建立在JS库或插件上.像其他人提到的那样,这里是发布文档 – http://dev.w3.org/csswg/cssom-view/#scrolling
当前采用的DOM的滚动行为由锚标签设置(例如:单击我).当所有浏览器完全采用此CSS属性并正确实现时(请参阅此讨论:https://groups.google.com/forum/#!topic/mozilla.dev.platform/mrsNyaLj3Ig).您将能够将“即时”锚标签滚动切换到更多“平滑”滚动.
真正的问题是当我们在边缘浏览器中使用此属性时?目前,它被Firefox& Chrome,但就研究而言,该属性并非“活跃”.
nav{ float:left }
#scroll {
width: 350px;
height: 500px;
scroll-behavior: smooth;
overflow: scroll;
border: 2px solid black;
}
#inside1 {
height: 1000px;
background-color: blue;
}
#inside2 {
height: 1000px;
background-color: orange;
}
#inside3 {
height: 1000px;
background-color: red;
}