js实现鼠标切换图片(无定时器)

2022-01-13,,,,

这篇文章主要为大家详细介绍了js实现鼠标切换图片,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

本文实例为大家分享了js实现鼠标切换图片的具体代码,供大家参考,具体内容如下

实现效果,可以利用鼠标移动在对应的小点点上,或者点击左右两侧的箭头切换图片,并在图片的上方显示出图片的页数,下方显示出对应图片的标题。

全部代码如下:

   图片切换 .picture { position: relative; width: 500px; height: 333px; margin: 0 auto; border: 2px solid rgb(231, 127, 217); overflow: hidden; } .radius { width: 100%; height: 10px; position: absolute; bottom: 30px; text-align: center; } .pg {     //图片上方页码 position: absolute; margin: 0; width: 100%; height: 20px; background-color: rgba(0, 0, 0, .4); text-align: center; font-size: 16px; font-weight: 600; color: #fff; } .title { position: absolute; width: 100%; bottom: 0px; text-align: center; font-size: 16px; font-weight: 600; color: rgb(21, 223, 72); } span { display: inline-block; border: 10px solid #fdfdfd; border-radius: 50%; } .active { border: 10px solid #656466; } /* 左右箭头 */ .arrowhead-left, .arrowhead-right { position: absolute; width: 41px; height: 69px; font-size: 30px; line-height: 70px; text-align: center; color: #D6D8D4; background-color: rgba(0,0,0,.3); } .arrowhead-left { left: 0; top: 40%; } .arrowhead-right { right: 0; top: 40%; }   

封面

标题

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持本站。

以上就是js实现鼠标切换图片(无定时器)的详细内容,更多请关注本站其它相关文章!

《js实现鼠标切换图片(无定时器).doc》

下载本文的Word格式文档,以方便收藏与打印。