我在使用CSS滚动捕捉时遇到问题。就整体图像而言,它使页面可以很好地工作,但是,如果我在页面上使用过多的滚轮,则会完全停止工作。请记住,此时普通滚动条仍然可以使用,但是我必须刷新页面才能使滚动再次开始使用。 该示例实际上可以在我的网站http://ckmontesano.com上查看,这是代码。
html, body {
margin: 0;
padding: 0;
background: var(--darkish);
scroll-behavior: smooth;
scroll-snap-type: y mandatory;
font-family: Roboto;
}
section {
scroll-snap-align: start;
scroll-snap-stop: always;
display: flex;
flex-flow: column wrap;
align-content: center;
justify-content: center;
width: 100%;
height: 100vh;
background: var(--blurple);
color: var(--white);
}
<div id='sectionContainer'>
<section id='main'>
<div id='content'>
<h1>Test Site</h1>
<h2>Welcome to the test site!</h2>
</div>
<div id='shader'></div>
</section>
</div>
如果需要更多信息,请随时提问!