简单的手写jquery轮播图(包含切换按钮、小圆点)
css代码
* {
margin: 0;
padding: 0;
}
.container {
width: 800px;
height: 400px;
margin: 100px auto;
position: relative;
overflow: hidden;
cursor: pointer;
}
.container img {
width: 800px;
position: absolute;
left: 0;
top: 0;
display: none;
}
.container img:first-child{
display: block;
}
.arrow {
width: 41px;
height: 69px;
background: url(../img/icon-slides.png) no-repeat;
cursor: pointer;
}
.left-arrow {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
background-position: -83px 0;
}
.left-arrow:hover{
background-position: 0 0;
}
.right-arrow {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50