实现的功能:
1.点击右侧按钮一次,图片往左播放一张,左侧按钮同理。
2.图片播放的同时,下面的小圆圈模块也跟随一起变化。
3.鼠标不经过轮播图,轮播图会自动向右播放图片,经过轮播图之后停止自动播放图片。
以下是所有代码:
CSS代码:
.contain img{
width: 600px;
height: 350px;
}
.contain{
width: 3000px;
height: 350px;
white-space: nowrap;
font-size: 0;
position: absolute;
left: 0;
}
.wrapper{
width: 600px;
height: 350px;
overflow: hidden;
margin: 0 auto;
position: relative;
}
.spots{
position: absolute;
left: 225px;
bottom:10px;
}
.spots span{
display: inline-block;
width: 10px;
height: 10px;
border: 3px solid white;
border-radius: 50%;
margin-right: 10px;
}
a{
text-decoration: none;
color: dimgrey;
font-size: 38px;
position: absolute;
top: 130px;
}
a:nth-of-type(1){
left: 10px;
}
a:nth-of-type(2){