<style>
* {
padding: 0;
margin: 0;
}
.banner {
position: relative;
width: 810px;
height: 320px;
margin: 50px auto;
background: grey;
overflow: hidden;
}
.img-list {
list-style: none;
position: absolute;
left: 0;
top: 0;
width: 5240px;
height: 320px;
}
.img-list li {
float: left;
}
.banner-nav-list {
list-style: none;
position: absolute;
right: 100px;
bottom: 50px;
}
.banner-nav-list li {
background: red;
float: left;
width: 20px;
height: 20px;
margin-right: 10px;
cursor: pointer;
text-align: center;
}
.banner-nav-list li.active {
background: yellow;
}
.banner .toLeft {
width: 60px;
height: 60px;
background: url(images/btn.gif);
position: absolute;
left: 30px;
top: 120px;
/*opacity: 0;*/
}
.banner .toRight {
width: 60px;
height: 60px;
background: url(images/btn.gif) 0px 60px;
position: absolute;
right: 30px;
top: 120px;
/*opacity: 0;*/
}
#arr {
opacity: 0;
}
</style>
</head>
<body>
<div class="banner" id="banner">
<ul class="img-list" id="img-list">
<li index="0"><img src="images/001.jpg"></li>
<li index="1"><img src="images/002.jpg"></li>
<li index="2"><img src="images/003.jpg"></li>
<li index="3"
用class构造函数实现轮播图效果
最新推荐文章于 2022-03-21 23:18:10 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)