我已经成功实现了幻灯片放映,这是我的代码
HTML
<div id="slider">
<figure>
<img src="images/slides/1.jpg" alt>
<img src="images/slides/1.jpg" alt>
<img src="images/slides/1.jpg" alt>
<img src="images/slides/1.jpg" alt>
<img src="images/slides/1.jpg" alt>
<img src="images/slides/1.jpg" alt>
</figure>
<div>
CSS:
@keyframes slidy {
0% { left: 0%; }
20% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}
div#slider { overflow: hidden; }
div#slider figure img { width: 20%; float: left; }
div#slider figure {
position: relative;
width: 500%;
margin: 0;
left: 0;
text-align: left;
font-size: 0;
animation: 30s slidy infinite;
}
现场演示: https://codepen.io/RamBM/pen/PEJXqg
现在我的问题是如何在幻灯片放映中实现下一个按钮箭头和上一个按钮箭头。