mirror of
https://git.topisto.net/tibo/template.git
synced 2026-03-31 23:49:11 +00:00
initialisation with SMETI code
This commit is contained in:
12
frontend/src/scripts/UI/IntersectionObserver/header.js
Normal file
12
frontend/src/scripts/UI/IntersectionObserver/header.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const headerObserver = new IntersectionObserver(entries => {
|
||||
entries.forEach(entry => {
|
||||
if (typeof headerIsVisible === 'function') headerIsVisible(entry.isIntersecting);
|
||||
});
|
||||
});
|
||||
|
||||
const header = document.querySelector("header");
|
||||
if (header) headerObserver.observe(header);
|
||||
else myLog('No header to observe');
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user