.nav-head:hover ~ .nav-submenu {
display: block
}
.nav-item:hover .nav-submenu {
display: block
}
$('.item').on('mouseover', '.dot', function({ delegateTarget: t }) {
$('.thumb-target', t).attr('src', this.dataset.img);
$('.dot', t).removeClass('select').filter(this).addClass('select');
});
document.querySelectorAll('.item').forEach(n => {
n.addEventListener('mouseover', onMouseOver);
});
function onMouseOver({ target: t, currentTarget: ct }) {
const dot = t.closest('.dot');
if (dot) {
ct.querySelector('.thumb-target').src = dot.dataset.img;
ct.querySelectorAll('.dot').forEach(n => {
n.classList.toggle('select', n === dot);
});
}
}
document.querySelector('.nav').addEventListener('mouseover', e => {
const data = e.target.closest('.nav-link')?.dataset;
if (data) {
document.querySelector('.preview-img').src = data.img;
document.querySelector('.preview-head').textContent = data.category;
}
});
$(".btn").click(function () {
$(this).parent().prevAll().find(".menu").removeClass("active");
$(this).parent().nextAll().find(".menu").removeClass("active");
$(this).next().toggleClass("active");
});
.menu.active {
display: block;
}