сделал открытие меню при наведении
This commit is contained in:
@@ -322,9 +322,12 @@ blocksMenu.forEach(block =>{
|
||||
let button = block.querySelector('.header-menu-list__next'),
|
||||
content = block.querySelector('.header-menu-list-next__content');
|
||||
|
||||
button.onclick = function () {
|
||||
button.addEventListener('mouseover', function (event) {
|
||||
if (document.querySelector('.header-menu-list-next__content.active')) {
|
||||
document.querySelector('.header-menu-list-next__content.active').classList.remove('active');
|
||||
}
|
||||
content.classList.add('active');
|
||||
}
|
||||
})
|
||||
|
||||
let nextButtons = block.querySelectorAll('.header-menu-list-next-content__item');
|
||||
|
||||
@@ -333,7 +336,7 @@ blocksMenu.forEach(block =>{
|
||||
|
||||
if (typeof className == 'undefined') return;
|
||||
|
||||
button.onclick = function () {
|
||||
button.addEventListener('mouseover', function (event) {
|
||||
if (block.querySelector('.header-menu-list-next-content__item.active')) {
|
||||
block.querySelector('.header-menu-list-next-content__item.active').classList.toggle('active');
|
||||
block.querySelector('.header-menu-list-next__content-next.active').classList.toggle('active');
|
||||
@@ -342,8 +345,7 @@ blocksMenu.forEach(block =>{
|
||||
|
||||
button.classList.toggle('active');
|
||||
document.querySelector(`.header-menu-list-next__content-next.${className}`).classList.toggle('active');
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
content.addEventListener('mouseout', function (event) {
|
||||
|
||||
Reference in New Issue
Block a user