自动滚动

This commit is contained in:
xu_yanfeng 2025-01-18 22:07:44 +08:00
parent 7e7dfabe8c
commit 43fb857060

View File

@ -51,7 +51,7 @@ export default defineComponent({
console.log("get ads ", toRaw(ads.value));
setInterval(() => {
return;
// return;
if (stopAutoScroll) {
return;
}
@ -59,7 +59,7 @@ export default defineComponent({
const el = elAd.value as HTMLElement;
let left = el.scrollLeft + adWidth;
if (el.scrollLeft + el.clientWidth > el.scrollWidth) {
if (el.scrollLeft + el.clientWidth >= el.scrollWidth) {
left = 0;
}
el.scrollTo({ left, behavior: "smooth" });