I have reviewed their demo examples and found that it supports displaying sub-menus when hovering over the menu. However, after purchasing the template, I am unable to use this feature. Is there a specific setting that needs to be configured in order to enable this functionality?
Hi @GunChung , you can check in theme customize if there is an option to select click or hover to display sub-menu or contact support of that theme for asking more detail
Thank you for your answer, i have tried to contact support of that theme.
The solution is to insert the following code at the location of the image tag.
const detailsEl = document.querySelectorAll(‘[data-section-type=“header”] details’);
//loop thru details
detailsEl.forEach((detail) => {
detail.addEventListener(‘mouseover’, () => {
// if the detail is not open, open it
if (!detail.hasAttribute(‘open’)) {
detail.setAttribute(‘open’, ‘’);
detail.setAttribute(‘aria-expanded’, ‘true’);
}
});
detail.addEventListener(‘mouseleave’, () => {
// if the detail is open, close it
if (detail.hasAttribute(‘open’)) {
detail.removeAttribute(‘open’);
detail.setAttribute(‘aria-expanded’, ‘false’);
}
});
});
