本文实例介绍了javascript实现图片轮播效果的详细代码,分享给大家供大家参考,具体内容如下
效果图:
具体代码:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{ margin: 0; padding: 0; } .wrap{ width: 510px; margin: 0 auto; overflow: hidden; position: relative; } .caktye{ width: 9999px; overflow: hidden; position: relative; left: 0; } .main{ text-align: center; position: absolute; bottom: 10px; /*border: 1px solid red;*/ left: 35%; } .main button{ width: 25px; height: 25px; text-align: center; line-height: 25px; border-radius: 25px; display: inline-block; border: none; } .active{ background-color: yellow; } .caktye a{ float: left; } .caktye img { display: block; width:510px; } #prevBtn{ display: block; position: absolute; left: 5px; bottom: 45%; width: 15px; height: 15px; /*overflow: hidden;*/ border-left: 5px solid ; border-top: 5px solid ; border-color: rgba(255,255,255,0.5); -webkit-transform: rotate(45deg); transform: rotate(-45deg); } #nextBtn{ display: block; position: absolute; right: 5px; bottom: 45%; width: 15px; height: 15px; /*overflow: hidden;*/ border-right: 5px solid; border-top: 5px solid; -webkit-transform: rotate(45deg); transform: rotate(45deg); border-color: rgba(255,255,255,0.5); /*background-color: rgba(255,255,255,0.8);*/ } </style> </head> <body> <div class="wrap"> <div class="caktye" id="inner"> <a href="###"><img src="/UploadFiles/2021-04-02/1.jpg">希望本文所述对大家学习javascript程序设计有所帮助。
标签:
javascript,图片轮播
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“javascript实现图片轮播效果”评论...