实现轮播图透明度切换+自动走

本文介绍了如何实现轮播图的透明度切换效果,并结合自动播放功能,提供了一个实现方案,包括CSS样式、HTML结构和JavaScript代码示例。
摘要由CSDN通过智能技术生成

实现轮播图透明度切换+自动走

style部分

<style>
        li{
   list-style: none;}
        *{
   margin:0; padding:0;}
        .banner{
   
            width: 590px;
            height: 470px;
            margin: 50px auto;
            border: 2px solid green;
            position: relative;
        }
        .banner li{
   
            width: 590px;
            height: 470px;
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
            transition: opacity 1s linear; 
        }
        .banner li:nth-of-type(1){
   
            opacity: 1;
        }
        .banner li img{
   
            width: 590px;
            height: 470px;
        }
        #page{
   
            position: absolute;
            left: 30px;
            bottom: 20px;
            overflow: hidden;
        }
        #page span{
   
            float: left;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #ccc;
            font-size: 12px;
            line-height: 20px;
            text-align: center;
            margin:0 4px;
        }
        #page span:nth-of-type(1){
   
            background: red;
        }
        #btn_left{
   
            width: 40px;
            height: 60px;
            position: absolute;
            top: 50%;
            margin-top: -30px;
            left: 0;
            background: rgba(0,0,0,0.5);
            color: #fff;
            text-align: center;
            line-height: 60px;
        }
        #btn_right{
   
            width: 40px;
            height
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值