Selaa lähdekoodia

关于我们

gzb
guozhongbo 1 vuosi sitten
vanhempi
commit
a30da63374
5 muutettua tiedostoa jossa 250 lisäystä ja 32 poistoa
  1. 93
    4
      css/about.css
  2. BIN
      img/about/leftjt.png
  3. BIN
      img/about/rightjt.png
  4. 143
    21
      js/about.js
  5. 14
    7
      sections/about.html

+ 93
- 4
css/about.css Näytä tiedosto

@@ -86,7 +86,7 @@
86 86
 .area_com {
87 87
   color: #666666;
88 88
   font-size: 0.14rem;
89
-  line-height: 0.24rem;
89
+  line-height: 0.3rem;
90 90
 }
91 91
 .area_right {
92 92
   flex: 3;
@@ -128,17 +128,17 @@
128 128
 }
129 129
 .area_fs{
130 130
   width: 2.8rem;
131
-  height: 3rem;
131
+  height: 3.2rem;
132 132
   background-color: white;
133 133
   color: #333333;
134 134
   text-align: center;
135
-  padding: 0 0.2rem;
135
+  padding: 0 0.1rem;
136 136
   box-sizing: border-box;
137 137
 }
138 138
 .area_fs img{
139 139
   width: 0.9rem;
140 140
   height: 0.8rem;
141
-  margin: 0.1rem auto 0;
141
+  margin: 0 auto 0;
142 142
 }
143 143
 .area_fs div {
144 144
   font-size: 0.18rem;
@@ -148,4 +148,93 @@
148 148
   font-size: 0.14rem;
149 149
   line-height: 0.24rem;
150 150
   margin-top: 0;
151
+}
152
+.develop_container{
153
+  height: 1.6rem;
154
+  position: relative;
155
+}
156
+.jt{
157
+  position: absolute;
158
+  top: 50%;
159
+  transform: translateY(-50%);
160
+  width: 0.15rem;
161
+  height: 0.26rem;
162
+  cursor: pointer;
163
+  z-index: 1000;
164
+}
165
+.leftjt{
166
+  left: 0;
167
+}
168
+.rightjt{
169
+  right: 0;
170
+}
171
+.showdata{
172
+  width: 90%;
173
+  height: 1.6rem;
174
+  margin: 0 auto;
175
+  position: relative;
176
+}
177
+.line{
178
+  width: 100%;
179
+  height: 0.04rem;
180
+  background-color: #f3f4f8ff;
181
+  position: absolute;
182
+  top: 50%;
183
+    transform: translateY(-50%);
184
+}
185
+.rounds{
186
+  width: 100%;
187
+  position: absolute;
188
+    top: 25%;
189
+    left: 0;
190
+    transform: translate(0, -50%);
191
+    white-space: nowrap;
192
+}
193
+.round_q{
194
+  display: inline-block;
195
+  width: 2.34rem;
196
+  height: 100%;
197
+}
198
+.round_item{
199
+  margin: 0 auto;
200
+  width: 0.18rem;
201
+  height: 0.18rem;
202
+  line-height: 0.18rem;
203
+  background-color: white;
204
+  border-radius: 50%;
205
+  border: 1px solid #e4e4e4ff;
206
+  position: relative;
207
+  cursor: pointer;
208
+}
209
+.round_i{
210
+  position: absolute;
211
+  top: 50%;
212
+  left: 50%;
213
+  transform: translate(-50%,-50%);
214
+  width: 0.12rem;
215
+    height: 0.12rem; 
216
+    background-color: #e4e4e4ff;
217
+    border-radius: 50%;
218
+}
219
+.round_d{
220
+  width: 0.9rem;
221
+  text-align: center;
222
+  font-size: 0.18rem;
223
+  color: #cccccc;
224
+  position: absolute;
225
+  top: 0.4rem;
226
+  left: -0.35rem;
227
+}
228
+.active .round_item{
229
+  border-color: #016cff;
230
+
231
+}
232
+.active .round_i {
233
+  background-color: #016cff;
234
+
235
+}
236
+.active .round_d {
237
+  color: #016cff;
238
+  font-size: 0.36rem;
239
+  font-weight: bold;
151 240
 }

BIN
img/about/leftjt.png Näytä tiedosto


BIN
img/about/rightjt.png Näytä tiedosto


+ 143
- 21
js/about.js Näytä tiedosto

@@ -1,21 +1,143 @@
1
- $(".main-timeline .timeline").click(function () {
2
-       var TAG = $(this).siblings().length;
3
-       if (TAG >= 1) {
4
-         var index = $(this).index()
5
-         $(this).addClass('fd-active-line').siblings().removeClass('fd-active-line')
6
-         $(this).parent().parent().siblings('.event_list').children().eq(index).show().siblings().hide()
7
-       }
8
-     })
9
-     var swiper = new Swiper('.swiper-container', {
10
-       slidesPerView: 4,
11
-       direction: 'vertical',
12
-       navigation: {
13
-         nextEl: '.swiper-button-next',
14
-         prevEl: '.swiper-button-prev',
15
-       },
16
-       on: {
17
-         resize: function () {
18
-           swiper.changeDirection(getDirection());
19
-         }
20
-       }
21
-     });
1
+var datalist = [
2
+  { time: 2023 },
3
+  { time: 2022 },
4
+  { time: 2021 },
5
+  { time: 2020 },
6
+  { time: 2019 },
7
+  { time: 2018 }
8
+];
9
+
10
+var html = "";
11
+$.each(datalist, (idx, item) => {
12
+  html += `<div class="round_q">
13
+                    <div class="round_item">
14
+                    <div class="round_i"></div>
15
+                    <div class="round_d">${item.time}</div>
16
+                  </div></div>`;
17
+});
18
+$(".rounds").width(datalist.length * 2.34 + "rem");
19
+$(".rounds").html(html);
20
+$(".round_q:first").addClass("active"); //默认第一个添加背景色
21
+//获取元素
22
+var divwidth = $(".round_q:first").width() - 54;
23
+console.log(divwidth);
24
+var container = $(".showdata");
25
+var list = $(".rounds");
26
+var buts = $(".round_q");
27
+var prev = $(".leftjt");
28
+var next = $(".rightjt");
29
+
30
+var index = 1; //存放当前显示的图片的下标
31
+var len = 5;
32
+var interval = 5000; //位移时间间隔
33
+var timer;
34
+
35
+function animate(offset) {
36
+  console.log(index);
37
+  var left = parseInt(list.css("left")) + offset;
38
+  console.log(left, offset);
39
+  // 边界判断
40
+  if (offset > 0) {
41
+    offset = "+=" + offset;
42
+  } else {
43
+    offset = "-=" + Math.abs(offset);
44
+  }
45
+
46
+  list.animate({ left: offset }, 300, function () {
47
+    if (left > -200) {
48
+      console.log(22);
49
+      list.css("left", (0 - offset) * len);
50
+    }
51
+    console.log(offset * len);
52
+    if (left < offset * len) {
53
+      console.log(111);
54
+      list.css("left", 0 - offset);
55
+    }
56
+  });
57
+}
58
+
59
+//亮起小圆点
60
+function showButton() {
61
+  //当前图片的小圆点亮起,其他小圆点不亮
62
+  console.log("gaoliang");
63
+  buts
64
+    .eq(index - 1)
65
+    .addClass("active")
66
+    .siblings()
67
+    .removeClass("active");
68
+}
69
+
70
+// 鼠标离开图片区域时,轮播继续
71
+function play() {
72
+  timer = setTimeout(function () {
73
+    next.trigger("click");
74
+    play();
75
+  }, interval);
76
+}
77
+
78
+//鼠标进入图片区域时,停止轮播
79
+function stop() {
80
+  clearTimeout(timer);
81
+}
82
+
83
+// 右按钮点击事件
84
+next.bind("click", function () {
85
+  // 判断当前是否在动画
86
+  if (list.is(":animated")) {
87
+    return;
88
+  }
89
+
90
+  // 判断当前图片是否是最后一张
91
+  if (index == 5) {
92
+    index = 1;
93
+  } else {
94
+    index += 1;
95
+  }
96
+  console.log("you", index);
97
+  animate(0 - divwidth);
98
+  showButton();
99
+});
100
+
101
+// 左按钮事件
102
+prev.bind("click", function () {
103
+  // 判断当前是否在动画
104
+  if (list.is(":animated")) {
105
+    return;
106
+  }
107
+
108
+  // 判断当前图片是否是第一张
109
+  if (index == 1) {
110
+    index = 5;
111
+  } else {
112
+    index -= 1;
113
+  }
114
+  console.log(zuo, index);
115
+  animate(divwidth);
116
+  showButton();
117
+});
118
+
119
+// 小圆点点击事件
120
+// buttons.each(function () {
121
+//   $(this).bind("click", function () {
122
+//     // 判断当前是否在进行动画
123
+//     if (list.is(":animated") || $(this).attr("class") == "on") {
124
+//       return;
125
+//     }
126
+//     // 获取属性
127
+//     var myIndex = parseInt($(this).attr("index"));
128
+
129
+//     //计算偏移量
130
+//     var offset = -600 * (myIndex - index);
131
+
132
+//     animate(offset);
133
+
134
+//     //切换后,更新当前的偏移量
135
+//     index = myIndex;
136
+
137
+//     showButton();
138
+//   });
139
+// });
140
+
141
+container.hover(stop, play);
142
+
143
+play();

+ 14
- 7
sections/about.html Näytä tiedosto

@@ -161,13 +161,20 @@
161 161
       <div class="piece">
162 162
         <div class="piece_item">
163 163
           <div class="area_title">发展历程</div>
164
-          <div class="swiper-container">
165
-            <!-- 如果需要分页器 -->
166
-            <div class="swiper-pagination"></div>
167
-
168
-            <!-- 如果需要导航按钮 -->
169
-            <div class="swiper-button-prev"></div>
170
-            <div class="swiper-button-next"></div>
164
+          <div class="develop_container">
165
+            <img class="leftjt jt" src="../img/about/leftjt.png" />
166
+            <img class="rightjt jt" src="../img/about/rightjt.png" />
167
+            <div class="showdata">
168
+              <div class="line"></div>
169
+              <div class="rounds">
170
+                <div class="round_q">
171
+                  <div class="round_item">
172
+                    <div class="round_i"></div>
173
+                    <div class="round_d">2023</div>
174
+                  </div>
175
+                </div>
176
+              </div>
177
+            </div>
171 178
           </div>
172 179
         </div>
173 180
       </div>

Loading…
Peruuta
Tallenna