Responsive menu item trigger for pop up does not work

I have added my Membership Pro login form in a Hustle Popup. The popup is triggered from a menu item which I set using css class. It works well when in desktop. But for smaller screens where it changes to a hamburger menu the trigger doesn’t work.

  • Adam
    • Support Gorilla

    Hi David

    I hope you’re well today and thank you for reporting this.

    I checked the site and I can see that:

    1 Currently it’s using #menu-item-1785 as a popup trigger and the mobile version of menu doesn’t have that ID but instead it uses #mobile-menu-item-1785

    2. However, setting trigger to #mobile-menu-item-1785 still does’t make popup open from mobile/hamburger menu anyway

    3. There’s .openpoplogin class that is present in both cases – in desktop and in mobile menu but using it doesn’t make it work form both menus either.

    There are some console errors in mobile view, though, so that might be related. We’ve already asked our developers to investigate the case to check why it’s not working as expected and we’ll update you here once we get to know more.

    Please keep an eye on this ticket for further information.

    Best regards,
    Adam

  • Alessandro
    • Nightcrawler & Daydreamer

    Hello David.

    I checked your website and found out an event listener attached to the mobile link which prevented the popup from showing up.

    The event listener is related to Bootstrap’s JS. Here is the code:
    function(a) {
    "#" === jQuery(this).attr("href") && ("modal" === jQuery(this).data("toggle") ? jQuery(this).trigger("show.bs.modal") : (a.preventDefault(), a.stopPropagation()), jQuery(this).next(".fusion-open-submenu").trigger("click"));
    }
    It seems to “block” any other event listener (in our case Hustle’s) with preventDefault() and stopPropagation() functions.

    The function seems to be called when the [href] attribute of an element is “#”. In your case the login link had “#” as href. To bypass it, I used javascript:void(0) as URL in the Login menu item (see attached).

    We updated the link’s URL and the popup now seems to be triggered with no issues on mobile as well.

    Let us know this worked for you. :blush:

    Kind regards,
    Alessandro.