参考博文:
https://blog.csdn.net/lgx1134569285/article/details/80511795
在原博文基础上进行了一些修改,使其实现其功能
实现效果:
1.自动滚动播放
2.鼠标移上去停止播放
3.点击左右箭头滚动播放
<!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