mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-06-17 19:43:30 +08:00
Merge c4fe7e8650
into 47832083d8
This commit is contained in:
commit
a3ab6d285e
@ -125,7 +125,14 @@ function setupScrollspy() {
|
||||
scrollHandler();
|
||||
}
|
||||
|
||||
// Use ResizeObserver to detect changes in the size of .article-content
|
||||
const articleContent = document.querySelector(".article-content");
|
||||
if (articleContent) {
|
||||
const resizeObserver = new ResizeObserver(debounced(resizeHandler));
|
||||
resizeObserver.observe(articleContent);
|
||||
}
|
||||
|
||||
window.addEventListener("resize", debounced(resizeHandler));
|
||||
}
|
||||
|
||||
export { setupScrollspy };
|
||||
export { setupScrollspy };
|
||||
|
Loading…
Reference in New Issue
Block a user