File size: 547 Bytes
c17a638
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
document.addEventListener('DOMContentLoaded', function() {
    var header = document.querySelector('.main-page-header');
    var content = document.querySelector('.content');

    var observer = new IntersectionObserver(function(entries) {
        entries.forEach(function(entry) {
            if (!entry.isIntersecting) {
                header.style.display = 'none';
            } else {
                header.style.display = 'block';
            }
        });
    }, { threshold: 0 });

    observer.observe(content);
});