js轮播图(自动播+点击播放)
今天介绍一下js轮播图的实现思路。废话不多说直接上代码。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{margin:0;
padding:0;
list-style:none;}
.wrap{
height:300px;
width:600px;
margin:60px auto;
overflow: hidden;
position: relative;
margin:100px auto;
}
/* 图片框 */
/* ol 定义有序列表
ul 定义无序列表
li 定义列表项 */
.wrap ul{
position:absolute;
}
.wrap ul li{
height:300px;
background-color: #E97305;
}
.wrap ol{
position:absolute;
right:5px;
bottom:10px;
}
.wrap ol li{
height:20px;
width: 20px;
background:#ccc;
border:solid 1px #666;
margin-left:5px;
color:#000;
float:left;
line-height:center;
text-align:center;
cursor:pointer;
}
.wrap ol .on{
background:#E97305;
color:#fff;
}
</style>
<script type="text/javascript">
window.onload=function(){
var