原生JS无缝滑动轮播图
本文实例为大家分享了原生JS无缝滑动轮播图的具体实现代码,供大家参考,具体内容如下
Document ul,div,img{ margin:0; padding:0; list-style:none; vertical-align:top; } #banner{ width:400px; height:300px; margin:50pxauto; position:relative; overflow:hidden; } #bannerul{ width:400px; position:absolute; } #bannerliimg{ width:400px; height:300px; text-align:center; line-height:300px; font-size:40px; } #dot{ height:20px; position:absolute; left:calc(50%-80px); bottom:20px; } #doti{ width:14px; height:14px; border-radius:50%; background:#fff; float:left; margin:010px; cursor:pointer; } #doti.current{ background:rgb(161,1,34); } #pages{ height:60px; width:100%; position:absolute; top:calc(50%-30px); cursor:pointer; } #pagesi{ width:30px; height:60px; background:rgb(0,0,0); font-size:22px; color:#fff; text-align:center; line-height:60px; opacity:0.5; font-style:normal; position:absolute; user-select:none; } #pagesi.gt{ right:0; top:0; font-size:21px; } #pagesi:hover{ opacity:0.7; }