js实现仿京东图片轮播效果,当鼠标划在窗口上面停止计时器,鼠标离开窗口,开启计时器,鼠标划在页签上面,停止计时器,手动切换,通过定义计时器封装函数run,封装函数changeOption,实现此效果,代码简单易懂,需要的小伙伴直接复制拷贝转走吧。
document *{margin:0;padding:0;list-style:none;} a{text-decoration: none;color: #fff;} #flash{width: 730px;height: 454px;margin: 100px auto;position: relative;cursor: pointer;} #pic li{position: absolute;top: 0;left: 0;z-index: 1;display: none;} #num{position: absolute;left: 40%;bottom: 10px;z-index: 2;cursor:default;} #num li{float: left;width: 20px;height: 20px;border-radius: 50%;background: #666;margin: 3px;line-height: 20px;text-align: center;color: #fff;cursor: pointer;} #num li.active{background: #f00;} .arrow{height: 60px;width: 30px;line-height: 60px;text-align: center;display: block;position: absolute;top:45%;z-index: 3;display: none;} .arrow:hover{background: rgba(0,0,0,0.7);} #flash:hover .arrow{display: block;} #left{left: 2%;} #right{right: 2%;}
< >
- 1
- 2
- 3
- 4
- 5
- 6
以上代码是不是很简单啊,基于javascrit实现仿金东图片轮播效果就制作成功了,由于时间原因没有给大家展示效果图,还请大家见谅。



