body { overflow-y: hidden;}.slides { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; display: flex; overflow-x: scroll;}section { height: 100vh; min-width: 80vw; display: flex; align-items: center; justify-content: center; background-repeat: no-repeat; background-size: cover; scroll-snap-align: start;}.section-1{background-color: blue;}.section-2{background-color: yellow;}.section-3{background-color: green;}.section-4{background-color: orange;}<main class="slides"> <section class="section-1"> <h2>Scroll right to see it in action</h2> </section> <section class="section-2"> <h3>this and that</h3> </section> <section class="section-3"> <h2>help</h2> </section> <section class="section-4"> <h3>please</h3> </section></main>我正在制作一個(gè)水平滾動(dòng)的輪播。在這個(gè) div 中有圖像,我正在使用 css 滾動(dòng)捕捉 where scroll-snap-align: start。列表中的下一個(gè)圖像(右側(cè)不可見的圖像)需要比當(dāng)前視圖中的圖像更不透明。這就是我想要的樣子(旋轉(zhuǎn)木馬的圖片)另外,當(dāng)我在這里時(shí),是否有任何人可以幫助無(wú)限滾動(dòng),所以圖像又從頭開始了?
使用 css 滾動(dòng)捕捉,如何使圖像不在視圖中模糊(不透明)?
動(dòng)漫人物
2022-06-09 19:32:12