jquery swiper实现可左右拖动的横向时间轴时间线效果代码

代码语言:html

所属分类:布局界面

代码描述:jquery swiper实现可左右拖动的横向时间轴时间线效果代码

代码标签: 左右 拖动 横向 时间 时间 线 效果

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

<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <!--防止IE进入怪异模式-->
  <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">
  <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
  <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(../images/line.png) 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.5.3.8.css">
</head>

<body>

  <div class="time-line-box">
    <div class="swiper-container">
      <ul class="layui-timeline swiper-wrapper">
        <li class="layui-timeline-item swiper-slide">
          <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">
          <div class="layui-timeline-content layui-text">
            <dl>
              <dt class="layui-timeline-title">2013年</dt>
              <dd>3月12日成立分公司</dd>
              <dd>5月05日公司成立14周年</dd>
            </dl>
          </div>
        </li>
        <li class="layui-timeline-item swiper-slide">
          <div class="layui-timeline-content layui-text">
            <dl>
              <dt class="layui-timeline-title">2014年</dt>
              <dd>3月12日成立分公司</dd>
              <dd>5月05日公司成立14周年</dd>
            </dl>
          </div>
        </li>
        <li class="layui-timeline-item swiper-slide">
          <div class="layui-timeline-content layui-text">
            <dl>
              <dt class="layui-timeline-title">2015年</dt>
              <dd>3月12日成立分公司</dd>
              <dd>5月05日公司成立14周年</dd>
            </dl>
    .........完整代码请登录后点击上方下载按钮下载查看

网友评论0