一.要实现的效果
1.点击左右可切换图片
2.点击小圆点 可切换图片
二.效果图
三.代码
1.css
body,img,span,ul,li{margin: 0;padding: 0;} #div1{width: 600px;height: 350px;margin: 150px auto;border: 10px solid #eee;position: relative;} img{width: 600px;height: 350px;} span{display: inline-block;position: absolute;width: 50px;height: 50px;border-radius: 25px;background:rgba(0,0,0,.3); font-size: 30px;line-height: 50px;text-align: center;cursor: pointer;color: white;} span:hover{background:rgba(255,255,255,.5);color:black;transform:scale(1.3);} span#L{left: 10px;top: 150px;} span#R{right: 10px;top: 150px;} #div1 #ul{position: absolute;bottom: 10px;left: 250px;width: 125px;height: 20px;} #div1 #ul li{list-style: none;float: left;height: 20px;width: 20px;border-radius: 10px;background:rgba(255,255,255,.5); margin-right: 5px;cursor: pointer;} #div1 #ul .active{background:rgba(0,0,0,.5);}
2.html
<
>
3.js
总结
以上所述是小编给大家介绍的JS 实现banner图片轮播效果(鼠标事件),希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对考高分网网站的支持!



