mirror of
https://git.topisto.net/tibo/template.git
synced 2026-03-31 21:39:10 +00:00
commit 20240914
This commit is contained in:
@@ -3,10 +3,10 @@ const handleFooterIntersection = function (entries) {
|
||||
// Loop through all the observed elements
|
||||
entries.forEach(entry => { // Check if the element is intersecting the viewport
|
||||
if (entry.isIntersecting) {
|
||||
console.log("The footer is visible in the viewport");
|
||||
msgConsole('IntersectionObserver','The footer is visible in the viewport');
|
||||
if (typeof footerIsNowVisible === 'function') footerIsNowVisible(entry);
|
||||
} else {
|
||||
console.log("The footer is invisible in the viewport");
|
||||
msgConsole('IntersectionObserver','The footer is invisible in the viewport');
|
||||
if (typeof footerIsNowInvisible === 'function') footerIsNowInvisible(entry);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
// Create a function that will handle any intersection between some elements and the viewport.
|
||||
const handleHeaderIntersection = function (entries) {
|
||||
entries.forEach(entry => {
|
||||
if (typeof headerIsVisible === 'function') headerIsNowVisible(entry.isIntersecting);
|
||||
if (entry.isIntersecting) {
|
||||
msgConsole('IntersectionObserver','The header is visible in the viewport');
|
||||
if (typeof headerIsNowVisible === 'function') headerIsNowVisible(entry);
|
||||
} else {
|
||||
msgConsole('IntersectionObserver','The header is invisible in the viewport');
|
||||
if (typeof headerIsNowInvisible === 'function') headerIsNowInvisible(entry);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ const handleSynthesisIntersection = function (entries) {
|
||||
entries.forEach(entry => {
|
||||
// Check if the element is intersecting the viewport
|
||||
if (entry.isIntersecting) {
|
||||
myLog("The synthesis is visible in the viewport");
|
||||
msgConsole('IntersectionObserver',"The synthesis is visible in the viewport");
|
||||
if (typeof synthesisTopIsNowVisible === 'function') synthesisIsNowVisible(entry);
|
||||
} else {
|
||||
myLog("The synthesis is invisible in the viewport");
|
||||
msgConsole('IntersectionObserver',"The synthesis is invisible in the viewport");
|
||||
if (typeof synthesisTopIsNowInvisible === 'function') synthesisIsNowInvisible(entry);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user