fixed js bug

master
A1Gard 2 weeks ago
parent bc061e7ecb
commit 6435c0a641

@ -1,12 +1,16 @@
const scrollBreakpoint = window.innerHeight * 0.2; const scrollBreakpoint = window.innerHeight * 0.2;
let fixmenu = function () { let fixmenu = function () {
if (window.scrollY > scrollBreakpoint){ try {
document.querySelector('.HomayonMenu').classList.add('fix'); if (window.scrollY > scrollBreakpoint){
document.querySelector('.HomayonMenu').querySelector('.homayon-middle').classList.remove('container'); document.querySelector('.HomayonMenu').classList.add('fix');
}else{ document.querySelector('.HomayonMenu').querySelector('.homayon-middle').classList.remove('container');
document.querySelector('.HomayonMenu').classList.remove('fix') }else{
document.querySelector('.HomayonMenu').querySelector('.homayon-middle').classList.add('container'); document.querySelector('.HomayonMenu').classList.remove('fix')
} document.querySelector('.HomayonMenu').querySelector('.homayon-middle').classList.add('container');
}
} catch {
}
} }
window.addEventListener('scroll',fixmenu); window.addEventListener('scroll',fixmenu);

Loading…
Cancel
Save