swiper实现横向可拖动时间线大事记效果代码

代码语言:html

所属分类:其他

代码描述:swiper实现横向可拖动时间线大事记效果代码

代码标签: swiper 横向 拖动 时间线 大事记

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<html lang="zh-CN">

<head>

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="renderer" content="webkit">
    <style>
        html
        body,
        ul,
        li,
        ol,
        dl,
        dd,
        dt,
        p,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        form,
        fieldset,
        legend,
        img {
          margin: 0;
          padding: 0;
        }
        li {
          list-style: none;
        }
        .time-line-box {
          margin-top: 40px;
        }
        .time-line-box ul:after {
          content: '';
          background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANMAAAA0CAYAAAAQRg3jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDQ4OCwgMjAyMC8wNy8xMC0yMjowNjo1MyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxucz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JOIZhIRzSSimUQ0k4hmEpEXoPeZyPshuetD3mgl7/o0siv+iItcI5X73Bui4mpqff0RM9GFRt1EzYaSN22p4SzkZbcMB6FmNyRXVGzZw36//0/XV4kLNRNZHOlCVHGkC1FdLYVB3ZClpvaUuMh8UXtJ3nJuan2VRt36dM5dOUJloaVjlwS+0+HKe6KRz2Rew2g0qjabTTUejz/+FkhhZD5CtKOXMVZlks87m1y6TumweU5M0cp4rVcbkvU9D2HJczTz2vF4fLw2GAwemuV35e/mtVfdOO9JvjK6KppZ2/M8iHe+kZP/PLK24XD40MrPWe+ng1USU/Qmk8kjX8Woieud43fT6+u5hr4FGAC0+YXqVIZVxQAAAABJRU5ErkJggg==) repeat-x left bottom;
          height: 52px;
          width: 1000%;
          position: absolute;
          left: 0;
          z-index: 1;
        }
        .time-line-box ul li {
          float: left;
          width: 211px;
          position: relative;
          padding-top: 176px;
          padding-bottom: 0;
          padding-left: 0;
          z-index: 2;
        }
        .time-line-box ul li:after {
          content: '';
          height: 124px;
          border-left: #d3d3d2 2px solid;
          position: absolute;
          top: 52px;
          left: 0;
        }
        .time-line-box ul li dl {
          padding-left: 25px;
        }
        .time-line-box ul li dl dt {
          font-size: 22px;
          color: #2DA891;
          font-weight: bold;
          position: relative;
          margin-bottom: 10px;
        }
        .time-line-box ul li dl dt:after {
          content: '';
          width: 8px;
          height: 8px;
          border-radius: 100%;
          background: #2DA891;
          position: absolute;
          left: -32px;
          top: 0;
          border: #a1d4cc 4px solid;
        }
        .time-line-box ul li dl dd {
          color: #333;
          font-size: 13px;
          line-height: 1.8;
          padding-left: 15px;
          position: relative;
        }
        .time-line-box ul li dl dd:after {
          content: '';
          width: 6px;
          height: 6px;
          border-radius: 100%;
          background: #2DA891;
          position: absolute;
          left: 0;
          top: 50%;
          margin-top: -3px;
        }
        .time-line-box ul li:first-child {
          margin-left: 95px;
        }
        .time-line-box ul li:last-child {
          margin-right: 40px;
        }
        .time-line-box ul li:nth-child(2n) {
          padding-top: 0;
        }
        .time-line-box ul li:nth-child(2n):after {
          top: auto;
          bottom: -51px;
          height: 76px;
          z-index: 2;
        }
        .time-line-box ul li:nth-child(2n) dt:after {
          left: -34px;
        }
        .time-line-box ul li:nth-child(2n) .layui-text {
          position: absolute;
          left: 0;
          bottom: 10px;
          border-left: #d3d3d2 2px solid;
        }
        .time-line-box ul .item-this:after {
          border-left: #2DA891 2px solid;
        }
        .time-line-box ul .item-this .layui-text {
          border-left: #2DA891 2px solid !important;
        }
    </style>
    <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/swiper.4.5.1.css">
</head>

<body>

    <div class="time-line-box">
        <div class="swiper-container swiper-container-initialized swiper-container-horizontal swiper-container-pointer-events swiper-container-free-mode">
            <ul class="layui-timeline swiper-wrapper" id="swiper-wrapper-7bd55c1fc712ba9f" aria-live="polite" style="padding-top: 166px; transition-duration: 0ms; transform: translate3d(-1815px, 0px, 0px);">
                <li class="layui-timeline-item swiper-slide" role="group" aria-label="1 / 10">
                    <div class="layui-timeline-content layui-text">
                        <dl>
                            <dt class="layui-timeline-title">2012年</dt>
                            <dd>3月12日成立分公司</dd>
                            <dd>5月05日公司成立14周年</dd>
                        </dl>
                    </div>
                </li>
                <li class="layui-timeline-item swiper-slide" role="group" aria-label="2 / 10">
                    <div class="layui-timeline-content layui-text">
                        <dl>
                            <dt class="layui-timeline-title">2013年</dt>
                            <d.........完整代码请登录后点击上方下载按钮下载查看

网友评论0