JS代码注释清晰明了,一看就懂!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>最简单的轮播效果</title>
<style>
* {
margin: 0;
padding: 0
}
.box {
width: 500px;
height: 300px;
border: 1px solid #ccc;
margin: 100px auto;
padding: 5px;
}
.inner {
width: 500px;
height: 300px;
position: relative;
overflow: hidden;
}
.inner img {
width: 500px;
height: 300px;
vertical-align: top
}
ul {
width: 1000%;
position: absolute;
list-style: none;
left: 0;
top: 0;
}
.inner li {
float: left;
}
ol {
position: absolute;
height: 20px;
right: 20px;
bottom: 20px;
text-align: center;
padding: 5px;
}
ol li {
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
background-color: #