• Dear support team,

    I build a 2-level mega-menu, with the submenus opening on click on my website. I want like to add an overlay to darken the rest of the page when the submenus are collapsed.

    To do so, I added an empty container block to my header, and applied the following style :

    .header__overlay {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
    background: rgba(0,0,0,0.5);
    z-index:99;
    }

    My idea was to change “display: none” to display: block” when a submenu is displayed, but I don’t know what would be the best way to do so.

    Is there a proper way to achive this ? I apologize if this is a basic question but I am not fully comfortable with javascript.

    Thank you in advance for your help.

    • This topic was modified 3 days, 14 hours ago by doowayne.
Viewing 1 replies (of 1 total)
  • Hi doowayne,

    Please check this page for some examples you can use to detect when a sub menu is opened or closed:

    https://www.megamenu.com/documentation/javascript-api/

    I’m afraid support beyond this isn’t something we can help with (it can get complex quite quickly), so you may need to request the assistance of a freelancer. If you’re looking for an overlay feature, then there is one already built into the Pro version. You can see a demo on the demo menu on megamenu.com.

    Regards,
    Tom

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.