H5前端轮播图简单实现

H5前端轮播图简单实现

h5和js代码

"chart"> "lb" src="img/lunbo1.jpg" alt=""> "lb" src="img/lunbo2.jpg" alt=""> "lb" src="img/lunbo3.jpg" alt=""> "prev" src="img/preImg.png" alt=""> "next" src="img/nexImg.png" alt="">

css样式

.chart{
     
    width: 100%;
    position: relative;
}
.lb{
     
    width: 100%;
    height: auto;
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    /*所有css变换一秒内执行完*/
    transition:all 1s;
}
.prev{
     
    position: absolute;
    left: 0;
    top: 400px;
    z-index: 2;
}
.next{
     
    position: absolute;
    right:0;
    top: 400px;
    z-index: 2;
}

右箭头图片右箭头
左箭头图片左箭头

你可能感兴趣的:(H5前端轮播图简单实现)