mirror of https://github.com/4xmen/xshop.git
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.
20 lines
706 B
JavaScript
20 lines
706 B
JavaScript
window.addEventListener('load', function () {
|
|
window.addEventListener('scroll',function (e) {
|
|
if (window.scrollY > 100){
|
|
document.querySelector('.SarvMenu').classList.add('fixed');
|
|
}else{
|
|
document.querySelector('.SarvMenu').classList.remove('fixed');
|
|
}
|
|
});
|
|
|
|
document.querySelector('#sarv-toggle').addEventListener('click',function () {
|
|
document.querySelector('#sarv-responsive-menu').style.display = 'flex';
|
|
});
|
|
|
|
document.querySelector('#sarv-responsive-menu').addEventListener('click',function (e) {
|
|
if (e.target == this){
|
|
document.querySelector('#sarv-responsive-menu').style.display = 'none';
|
|
}
|
|
})
|
|
})
|