Line 95: | Line 95: | ||
<!--headerTransition--> | <!--headerTransition--> | ||
<script> | <script> | ||
− | + | window.addEventListener('scroll', () => { | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
var h = document.getElementById('topHeader'); | var h = document.getElementById('topHeader'); | ||
height = h.clientHeight; | height = h.clientHeight; | ||
let header = document.querySelector('header'); | let header = document.querySelector('header'); | ||
let logo = document.querySelector('.logo'); | let logo = document.querySelector('.logo'); | ||
− | + | header.classList.toggle('sticky', window.scrollY > height); | |
− | header.classList.toggle('sticky', | + | logo.classList.toggle('sticky', window.scrollY > height); |
− | logo.classList.toggle('sticky', | + | |
}); | }); | ||
+ | |||
</script> | </script> | ||
</html> | </html> |