Ver código fonte

关于我们

gzb
guozhongbo 1 ano atrás
pai
commit
1484f993e2
3 arquivos alterados com 14 adições e 16 exclusões
  1. 1
    1
      css/about.css
  2. 0
    0
      img/about/rightjt.png
  3. 13
    15
      js/about.js

+ 1
- 1
css/about.css Ver arquivo

@@ -128,7 +128,7 @@
128 128
 }
129 129
 .area_fs {
130 130
   width: 2.8rem;
131
-  height: 3rem;
131
+  height: 2.8rem;
132 132
   background-color: white;
133 133
   color: #333333;
134 134
   text-align: center;

img/about/righttj.png → img/about/rightjt.png Ver arquivo


+ 13
- 15
js/about.js Ver arquivo

@@ -18,7 +18,7 @@ $.ajax({
18 18
   contentType: "application/json; charset=utf-8",
19 19
   success: function (data) {
20 20
     if (data.code === 0) {
21
-      datalist = data.obj;
21
+      // datalist = data.obj;
22 22
     } else {
23 23
       alert(data.msg);
24 24
     }
@@ -29,7 +29,7 @@ $.each(datalist, (idx, item) => {
29 29
   html += `<div class="round_q" index = "${idx + 1}">
30 30
                     <div class="round_item">
31 31
                     <div class="round_i"></div>
32
-                    <div class="round_d">${item.dhyear}</div>
32
+                    <div class="round_d">${item.time}</div>
33 33
                   </div></div>`;
34 34
 });
35 35
 $(".rounds").width(datalist.length * 2.34 + "rem");
@@ -110,7 +110,8 @@ function animates(offset) {
110 110
     return;
111 111
   }
112 112
   var left = parseInt(list.css("left")) + offset; //获取元素属性
113
-  if (index <= 5 && left >= 0) {
113
+  if (index < 6 && left >= 0) {
114
+    list.animate({ left: 0 }, 300, function () {});
114 115
     return;
115 116
   }
116 117
   // 边界判断
@@ -125,12 +126,7 @@ function animates(offset) {
125 126
       offleft = offset;
126 127
     }
127 128
   }
128
-
129
-  list.animate({ left: offset }, 300, function () {
130
-    if (left > -200) {
131
-      list.css("left", (0 - offset) * len);
132
-    }
133
-  });
129
+  list.animate({ left: offset }, 300, function () {});
134 130
 }
135 131
 //亮起小圆点
136 132
 function showButton() {
@@ -143,7 +139,8 @@ function showButton() {
143 139
 }
144 140
 
145 141
 $(".develop_container").bind("mouseenter", () => {
146
-  stop();
142
+  clearTimeout(timer);
143
+    timer=null;
147 144
 });
148 145
 $(".develop_container").bind("mouseleave", () => {
149 146
   play();
@@ -163,6 +160,7 @@ function play() {
163 160
 function stop() {
164 161
   if (timer) {
165 162
     clearTimeout(timer);
163
+    timer=null;
166 164
   }
167 165
 }
168 166
 
@@ -206,12 +204,12 @@ prev.bind("click", function () {
206 204
   } else {
207 205
     index -= 1;
208 206
   }
209
-
207
+  stop();
210 208
   animate(divwidth);
211 209
   showdata(index - 1);
212 210
   showButton();
213 211
 
214
-  stop();
212
+ 
215 213
 });
216 214
 
217 215
 // 小圆点点击事件
@@ -221,19 +219,19 @@ buts.each(function () {
221 219
     if (list.is(":animated") || $(this).attr("class") == "on") {
222 220
       return;
223 221
     }
224
-    // 获取属性
225 222
     var myIndex = parseInt($(this).attr("index"));
226 223
     if (myIndex == index) {
227 224
       return;
228 225
     }
229 226
     //计算偏移量
230 227
     var offset = (0 - divwidth) * (myIndex - index);
228
+    index = myIndex;
231 229
     animates(offset);
232 230
     // list.animate({ left: -360 });
233
-    //切换后,更新当前的偏移量
234
-    index = myIndex;
231
+    
235 232
     showdata(index - 1);
236 233
     showButton();
234
+    stop();
237 235
   });
238 236
 });
239 237
 showdata(0);

Carregando…
Cancelar
Salvar