Browse Source

产品中心

gzb
guozhongbo 1 year ago
parent
commit
b45f5f1610
3 changed files with 23 additions and 10 deletions
  1. 8
    3
      css/product.css
  2. 14
    6
      js/product.js
  3. 1
    1
      sections/product.html

+ 8
- 3
css/product.css View File

189
 }
189
 }
190
 .exam_item {
190
 .exam_item {
191
   height: 1rem;
191
   height: 1rem;
192
+  margin-bottom: 0.2rem;
192
 }
193
 }
193
  
194
  
194
 .exam_item img{
195
 .exam_item img{
197
 }
198
 }
198
 .exam_content {
199
 .exam_content {
199
   width: 100%;
200
   width: 100%;
200
-  height: 5rem;
201
+  height: 6rem;
201
   position: relative;
202
   position: relative;
202
   overflow: hidden;
203
   overflow: hidden;
203
 }
204
 }
204
 .show_exam{
205
 .show_exam{
205
   width: 100%;
206
   width: 100%;
206
-  height: 5rem;
207
+  height:  100%;
207
   position: absolute;
208
   position: absolute;
208
   top: 0;
209
   top: 0;
209
   left: 0;
210
   left: 0;
210
 }
211
 }
212
+.exam_slide{
213
+  width: 100%;
214
+  height:  100%;
215
+}
211
 .exam_content img {
216
 .exam_content img {
212
   width: 9.8rem;
217
   width: 9.8rem;
213
-  height: 5rem;
218
+  height:  100%;
214
   object-fit: cover;
219
   object-fit: cover;
215
 }
220
 }
216
 .exam_slide{
221
 .exam_slide{

+ 14
- 6
js/product.js View File

1
 //获取元素
1
 //获取元素
2
-var divheight = $(".show_exam:first").height();
2
+var divheight = $(".exam_one").height()-70;
3
 var container = $(".exam_container");
3
 var container = $(".exam_container");
4
 var list = $(".show_exam");
4
 var list = $(".show_exam");
5
 var buts = $(".exam_item");
5
 var buts = $(".exam_item");
13
   var top = parseInt(list.css("top")) + offset;
13
   var top = parseInt(list.css("top")) + offset;
14
   console.log(list.css("top"));
14
   console.log(list.css("top"));
15
   var absnum = Math.abs(offset);
15
   var absnum = Math.abs(offset);
16
-  console.log(index, top, offset);
16
+  index++
17
+ 
17
   // 边界判断
18
   // 边界判断
18
-  if (offset > 0) {
19
-    offset = "+=" + offset;
20
-  } else {
21
-    offset = "-=" + Math.abs(offset);
19
+  // if (offset > 0) {
20
+  //   offset = "+=" + offset;
21
+  // } else {
22
+  //   offset = "-=" + Math.abs(offset);
23
+  // }
24
+  offset = "-=" + Math.abs(offset);
25
+  if(index == 6){
26
+    index = 1;
27
+    offset=0;
28
+    console.log("最后一个");
22
   }
29
   }
30
+  console.log("当前索引",index, top, offset)
23
   list.animate({ top: offset }, 300, function () {
31
   list.animate({ top: offset }, 300, function () {
24
     if (top > -200) {
32
     if (top > -200) {
25
     }
33
     }

+ 1
- 1
sections/product.html View File

166
                 <div class="show_exam">
166
                 <div class="show_exam">
167
                   <div class="exam_slide">
167
                   <div class="exam_slide">
168
                     <span>1</span>
168
                     <span>1</span>
169
-                    <img src="../img/product/mtznh.png" />
169
+                    <img class="exam_one" src="../img/product/mtznh.png" />
170
                   </div>
170
                   </div>
171
                   <div class="exam_slide">
171
                   <div class="exam_slide">
172
                     <span>2</span>
172
                     <span>2</span>

Loading…
Cancel
Save