Links not working on mobile menu when using Slicknav

312 views Asked by At

I have a menu. On the desktop, my default menu on hovering to parent-link1 opens a dropdown, and if I click on parent-link1, a redirect occurs. But on mobile using slicknav this link does not work as it opens a dropdown when clicked.

Could you suggest how you can get around this? For example, use a double click or what to open a dropdown by clicking on the li block and on the tag to implement the triggering of the link?

        <header class="header-section">
            <ul class="main-menu" data-id="menu">
                <li><a href="default-link">Home</a></li>
                <li>
                    <a href="parent-link1">Categories</a>
                    <ul>
                        <li><a href="cild-link1">cild 1</a></li>
                        <li><a href="cild-link2">cild 2</a></li>
                    </ul>
                </li>
            </ul>
            <div class="mobile-menu_wrapper"></div>
        </header>

Generated slicknav menu enter image description here

1

There are 1 answers

0
Alice On

work for me allowParentLinks: true

$(options.menuClass).slicknav({
    appendTo: '.mobile-menu_wrapper',
    allowParentLinks: true
});