87,838
社区成员




section.middle{
width: 760px;
height: 400px;
overflow: hidden;
position: relative;
}
section.middle ul:first-child{
position: absolute;
list-style-type: none;
margin: 0;
padding: 0;
width: 400%;
height: 100%;
top: 0;
left: 0;
background: #6f42c1;
}
section.middle>ul:first-child>li{
width: 25%;
height: 100%;
float: left;
}
section.middle>ul:first-child img{
width: 100%;
}
/*轮播图下方四个圆点*/
section.middle>ul:nth-child(2){
position: absolute;
bottom: 15px;
left: 340px;
}
section.middle>ul:nth-child(2) li{
float: left;
margin-left: 12px;
}
section.middle>ul:nth-child(2) a{
display: block;
width: 8px;
height: 8px;
background: #666;
border-radius: 50%;
}
window.onload = function(){
//获取轮播图的相框
var showImg = document.getElementById('wrapper');
//获取装四张轮播图的ul
var imgUl = showImg.getElementsByTagName('ul')[0];
//定义轮播方法
function move(){
imgUl.style.left = imgUl.offsetLeft - 760 + 'px';
}
setInterval(move, 1000);
}