使用JQuery实现轮播图
1.自动轮播(设置定时器)
2.左右点击实现切换图片
3.点击小圆点实现图片的任意切换
1.css样式
#img {
width: 1000px;
height: 700px;
background: url(../img/0.jpg) no-repeat;
background-size: 1000px 700px;
position: relative;
margin: 20px auto;
}
#btnLeft,
#btnRight {
width: 50px;
height: 50px;
position: absolute;
color: #87CEEB;
font-size: 48px;
line-height: 48px;
border-radius: 48px;
text-align: center;
border-color: aliceblue;
}
#btnLeft {
left: 0px;
top: 300px;
background: transparent;
}
#btnRight {
left: 950px;
top: 300px;
background: transparent;
}
ul {
position: absolute;
top: 630px;
left: 10px;
}
ul>li {
list-style: none;
width: 10px;
height: 10px;
background: white;
border-radius: 5px;
margin: 5px;
float: left;
background-color: rgba(0, 0, 0, 0.5);
}
2.html
<!DOCTYPE html>
<html>
<head>
<