Okay
  Public Ticket #3731482
trigger burger menu
Closed

Comments

  • hyuneek started the conversation

    hello, how can I trigger the fullscreen Asli Burger Menu using a custom button?

  •  33
    Artem replied

    Hello! The plan would be to trigger the `click` handler on the burger opener element.

    1. The JS code would look like this:

    const el = document.querySelector('.js-header__overlay-switcher');
    
    if (el && window.app && window.app.utilities) {
      app.utilities.dispatchEvent('click', {}, el);
    }

     2. Add the code above inline to `onclick` handler of your button like this:

    <a href="#" onclick='event.preventDefault(); const el=document.querySelector(".js-header__overlay-switcher");el&&window.app&&window.app.utilities&&app.utilities.dispatchEvent("click",{},el);'>My Custom Button</a>