瀏覽代碼

1秒滚动50px

lifanagju_citu 11 月之前
父節點
當前提交
58d07aeccc
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/views/personal/myPublicRecruitment/components/bountyDisplay.vue

+ 1 - 1
src/views/personal/myPublicRecruitment/components/bountyDisplay.vue

@@ -112,7 +112,7 @@ const scroll = () => {
     }
   }
   // 不断滚动
-  scrollItem.value = requestAnimationFrame(scroll)
+  setTimeout(() => { scrollItem.value = requestAnimationFrame(scroll) }, 20) // 20 : 1px。即:1秒滚动50px
 }
 const handleMouseover = () => { cancelAnimationFrame(scrollItem.value) } //暂停滚动
 const handleMouseleave = () => { scroll() } // 恢复滚动