You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/resources/views/segments/menu/DeebaMenu/DeebaMenu.js

15 lines
519 B
JavaScript

const scrollBreakpoint = window.innerHeight * 0.7;
window.addEventListener('scroll',function () {
if (window.scrollY > scrollBreakpoint){
document.querySelector('#DeebaMenu').classList.add('active')
}else{
document.querySelector('#DeebaMenu').classList.remove('active')
}
});
window.addEventListener('load',function () {
document.querySelector('#deeba-toggle')?.addEventListener('click',function () {
document.querySelector('#deeba-sided').classList.toggle('show');
});
});