我设置了 CSS Scroll Snap,如果可能的话,我想对其实施缓动。一旦它捕捉到一个点,它就会滚动得太快。有没有办法使用 CSS、JavaScript 或外部动画库来调整滚动捕捉速度/缓动?我的项目是 ASP.NET Core 5 MVC Web 应用程序。
html, body {
margin: 0;
padding: 0;
scroll-snap-type: y proximity;
}
.landing-page-content {
scroll-snap-align: center;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.landing-page-content h1 {
color: black;
margin: 0;
}
.s1 {
background-color: red;
}
.s2 {
background-color: yellow;
}
.s3 {
background-color: blue;
}
.s4 {
background-color: green;
}
.background-image {
background-image: url(..pathToImage);
position: absolute;
top: 0px;
right: 0px;
height: 100%;
width: 100vw;
background-repeat: no-repeat; …Run Code Online (Sandbox Code Playgroud)