本文实例为大家分享了Javascript实现无限轮播效果的具体代码,供大家参考,具体内容如下
效果展示
原理
图片说明原理
轮播顺序:1–>2–>3–>4–>5–>1的副本–>2–>3–>4–>5–>1的副本–>2…一直循环
鼠标进入图片时自动轮播暂停,离开后恢复
资源下载
代码
无限轮播 * { margin: 0; padding: 0; list-style: none; } img { vertical-align: top; } #slider { width: 520px; height: 280px; border: 1px solid #000; padding: 10px; margin: 100px auto; position: relative; } #top { width: 100%; height: 100%; position: relative; overflow: hidden; } #top ul { width: 3120px; height: 100%; position: absolute; left: 0; top: 0; } #top ul li { width: 520px; height: 280px; float: left; } #slider ol { position: absolute; right: 10px; bottom: 10px; } #slider ol li { width: 20px; height: 20px; background-color: darkgrey; display: inline-block; border-radius: 50%; margin-right: 3px; cursor: pointer; } #slider ol li.current { background-color: orangered; }
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



