在jQuery之焦点图转换-左右的基础上,将jQuery代码改成js原生,并添加定时器(setInterval()和clearInterval())
<Meta charset="UTF-8">
焦点图转换--原生和定时器
img{display: block;cursor: pointer;opacity: 0.8; position: absolute;top: 142px;left: 30px;}
.pic-show>img:last-child{display: block; position: absolute;left: 414px; }
ul{width: 120px;height: 18px;position: absolute;top: 280px;left: 185px;}
li{float: left;width: 20px;height: 18px;margin-left: 5px;}
a{display: block;width: 20px;height: 18px;text-decoration: none;border: 1px solid #ccc;border-radius: 50%;background-color: #ccc;opacity: 0.6;}
a:hover{background-color: #094a99;}
.aCss{background-color: #094a99;}
p{width: 480px;text-align: center;}