mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-28 19:43:31 +08:00
Merge d166b24d59
into 9e6b7b22a9
This commit is contained in:
commit
44732e8456
@ -125,6 +125,15 @@ 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(() => {
|
||||
resizeHandler();
|
||||
});
|
||||
resizeObserver.observe(articleContent);
|
||||
}
|
||||
|
||||
window.addEventListener("resize", debounced(resizeHandler));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user