first commit

This commit is contained in:
编码猿
2024-09-27 00:57:27 +08:00
commit 18df0f5e4b
2548 changed files with 253280 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
export function scrollToAnchor(selector) {
let count = 0;
const timer = setInterval(() => {
const el = document.querySelector(selector);
if (el) {
el.scrollIntoView({
behavior: 'smooth',
});
clearInterval(timer);
} else {
count++;
if (count > 10) {
clearInterval(timer);
}
}
}, 100);
}