Parcourir la source

1秒滚动50px

lifanagju_citu il y a 11 mois
Parent
commit
58d07aeccc

+ 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() } // 恢复滚动