Ver Fonte

修复轮播 bug

QAQ 陈 há 4 meses atrás
pai
commit
3de3b68618
2 ficheiros alterados com 3 adições e 5 exclusões
  1. 2 2
      pages/homepage/homepage.js
  2. 1 3
      pages/homepage/homepage.wxss

+ 2 - 2
pages/homepage/homepage.js

@@ -285,7 +285,7 @@ Page({
 
     const content = data[this.data.currentIndex].scrollingcontent;
     const title = data[this.data.currentIndex].noticetitle;
-    const duration = (title.length + content.length) * 0.4;
+    const duration = (title.length + content.length) * 0.5;
 
     this.setData({
       scrollDuration: duration,
@@ -298,7 +298,7 @@ Page({
       isScrolling: false
     });
 
-    // 等待1秒后切换到下一条
+    // 等待2秒后切换到下一条
     setTimeout(() => {
       const nextIndex = (this.data.currentIndex + 1) % this.data.noticeList.length;
       this.setData({

+ 1 - 3
pages/homepage/homepage.wxss

@@ -353,8 +353,6 @@
   color: rgba(104, 108, 128, 1);
   line-height: 50rpx;
   white-space: nowrap;
-  position: absolute;
-  left: 0;
   transform: translateX(100%);
 }
 
@@ -364,7 +362,7 @@
 
 @keyframes marquee {
   from {
-    transform: translateX(100%);
+    transform: translateX(120%);
   }
   to {
     transform: translateX(-100%);