Update extra.js (#17665)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
652e05e833
commit
87b7a6a090
4 changed files with 186 additions and 100 deletions
|
|
@ -57,14 +57,17 @@ function setupGiscusLoader() {
|
|||
const giscusContainer = document.getElementById("giscus-container");
|
||||
|
||||
if (giscusContainer) {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
loadGiscus();
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.1 }); // Trigger when 10% of the element is visible
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
loadGiscus();
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ threshold: 0.1 },
|
||||
); // Trigger when 10% of the element is visible
|
||||
|
||||
observer.observe(giscusContainer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue