无缝轮播走马灯

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>轮播图</title>
    <style>
      .wrap {
        position: relative;
        width: 400px;
        height: 300px;
        overflow: hidden;
        margin: 100px auto 0;
        border: 2px solid red;
      }
      .wrap-imageList {
        position: absolute;
        left: 0px;
        width: 1200px;
        height: 300px;
        background-color: black;
      }
      .wrap-imageList-image {
        float: left;
        width: 400px;
        height: 300px;
      }
      .animationBefore {
        animation: animationBefore 12s infinite;
        animation-fill-mode: forwards;
      }
      .animationAfter {
        animation: animationAfter 12s infinite;
        animation-fill-mode: none;
      }
      @keyframes animationBefore {
        0% {
          left: 0;
        }
        8.3% {
          left: 0;
        }
        16.6% {
          left: -400px;
        }
        24.9% {
          left: -400px;
        }
        33.2% {
          left: -800px;
        }
        41.5% {
          left: -800px;
        }
        49.8% {
          left: -1200px;
        }
        91.2% {
          left: -1200px;
        }
        91.3% {
          left: 400px;
        }
        100% {
          left: 0px;
        }
      }
      @keyframes animationAfter {
        0% {
          left: 400px;
        }
        41.5% {
          left: 400px;
        }
        49.8% {
          left: 0px;
        }
        58.1% {
          left: 0px;
        }
        66.4% {
          left: -400px;
        }
        74.7% {
          left: -400px;
        }
        83% {
          left: -800px;
        }
        91.3% {
          left: -800px;
        }
        100% {
          left: -1200px;
        }
      }
    </style>
  </head>
  <body>
    <div class="wrap">
      <div class="wrap-imageList animationAfter" style="left: 400px">
        <img
          class="wrap-imageList-image"
          src="../img/team-style-image-3.png"
          alt=""
        />
        <img
          class="wrap-imageList-image"
          src="../img/team-style-image-5.png"
          alt=""
        />
        <img
          class="wrap-imageList-image"
          src="../img/team-style-image-6.png"
          alt=""
        />
      </div>
      <div class="wrap-imageList animationBefore">
        <img
          class="wrap-imageList-image"
          src="../img/team-style-image-3.png"
          alt=""
        />
        <img
          class="wrap-imageList-image"
          src="../img/team-style-image-5.png"
          alt=""
        />
        <img
          class="wrap-imageList-image"
          src="../img/team-style-image-6.png"
          alt=""
        />
      </div>
    </div>
  </body>
</html>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值